Skip to contentSkip to conversation

hlist initilization

NETLINK Pablo Neira 2 participants 2 messages Sep 24, 2004

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi Davem,

This patch adds proper initialization for hlist. It applies to af_netlink.c with the workqueue patch reverted.

regards,
Pablo

===== net/netlink/af_netlink.c 1.55 vs edited =====

net/netlink/af_netlink.c +4 -0
@@ -1191,6 +1191,10 @@
 static int __init netlink_proto_init(void)
 {
 	struct sk_buff *dummy_skb;
+	int i;
+
+	for(i=0; i<MAX_LINKS; i++)
+		INIT_HLIST_HEAD(&nl_table[i]);
 
 	if (sizeof(struct netlink_skb_parms) > sizeof(dummy_skb->cb)) {
 		printk(KERN_CRIT "netlink_init: panic\n");
#1 lore raw
Quoted 2 lines · On Fri, 24 Sep 2004 03:05:56 +0200 Pablo Neira <[email protected]> wrote:

This patch adds proper initialization for hlist. It applies to af_netlink.c with the workqueue patch reverted.

nl_table[] is in the BSS and therefore will be
properly zero initialized already.

I took advantage of this same property in the
net/ipv4/fib_hash.c changes.