[Devel] [patch 2/2] net namespace : fix bad hash dev list initialization

dlezcano at fr.ibm.com dlezcano at fr.ibm.com
Fri Dec 15 09:20:51 PST 2006


From: Daniel Lezcano <dlezcano at fr.ibm.com>

Signed-off-by: Daniel Lezcano <dlezcano at fr.ibm.com>

---
 net/core/dev.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

Index: 2.6.19-mm1/net/core/dev.c
===================================================================
--- 2.6.19-mm1.orig/net/core/dev.c
+++ 2.6.19-mm1/net/core/dev.c
@@ -188,6 +188,7 @@ EXPORT_SYMBOL(dev_base);
 DEFINE_RWLOCK(dev_base_lock);
 EXPORT_SYMBOL(dev_base_lock);
 
+#define dev_hash_size (sizeof(struct hlist_head)*(1<<NETDEV_HASHBITS))
 #ifdef CONFIG_NET_NS
 #define dev_name_head (current_net_ns->net_device.name_head)
 #define dev_index_head (current_net_ns->net_device.index_head)
@@ -3647,10 +3648,10 @@ static int __init net_dev_init(void)
 	for (i = 0; i < 16; i++) 
 		INIT_LIST_HEAD(&ptype_base[i]);
 
-	for (i = 0; i < ARRAY_SIZE(dev_name_head); i++)
+	for (i = 0; i < dev_hash_size; i++)
 		INIT_HLIST_HEAD(&dev_name_head[i]);
 
-	for (i = 0; i < ARRAY_SIZE(dev_index_head); i++)
+	for (i = 0; i < dev_hash_size; i++)
 		INIT_HLIST_HEAD(&dev_index_head[i]);
 
 	/*

-- 
_______________________________________________
Containers mailing list
Containers at lists.osdl.org
https://lists.osdl.org/mailman/listinfo/containers




More information about the Devel mailing list