Discussion:
patch for 2.6.26
Tormod Volden
2008-07-28 21:44:32 UTC
Permalink
Hi,
The netdevice namespace code changed in 2.6.26 and a new CONFIG_NET_NS
was introduced. If I understand correctly, the nd_net bit we added for
2.6.24 must now only be used if CONFIG_NET_NS is set. I am not sure
this is the most clean and correct way to handle this, but the below
patch seems to work.

Tormod

http://archive.netbsd.se/?ml=linux-netdev&a=2007-10&t=5568294
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c346dca10840a874240c78efe3f39acf4312a1f2
http://cateee.net/lkddb/web-lkddb/NET_NS.html


--- trunk/src/p80211/p80211netdev.c 2008-04-03 22:42:58.000000000 +0200
+++ p80211netdev.c 2008-07-28 21:06:36.000000000 +0200
@@ -948,8 +948,10 @@ int wlan_setup(wlandevice_t *wlandev)
#endif

#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24) )
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26) || defined(CONFIG_NET_NS))
dev->nd_net = &init_net;
#endif
+#endif

#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,38) )
dev->tbusy = 1;
Pavel Roskin
2008-07-28 23:14:29 UTC
Permalink
Post by Tormod Volden
Hi,
The netdevice namespace code changed in 2.6.26 and a new CONFIG_NET_NS
was introduced. If I understand correctly, the nd_net bit we added for
2.6.24 must now only be used if CONFIG_NET_NS is set. I am not sure
this is the most clean and correct way to handle this, but the below
patch seems to work.
Actually, if you look at the patch between Linux 2.6.25 and 2.6.26,
you'll see several changes like this:

- dev->nd_net = &init_net;
+ dev_net_set(dev, &init_net);

And that's what we should be doing, I believe.

Index: src/p80211/p80211netdev.c
===================================================================
--- src/p80211/p80211netdev.c (revision 1865)
+++ src/p80211/p80211netdev.c (working copy)
@@ -947,7 +947,9 @@
#endif
#endif

-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24) )
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26) )
+ dev_net_set(dev, &init_net);
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24) )
dev->nd_net = &init_net;
#endif


Also the kernel version probing should be fixed. Linux 2.6.27 will need
changes to accommodate changes in Wireless Extensions API (but they are
already in updated Fedora 9 kernels). I'll post those patches
separately.
--
Regards,
Pavel Roskin
Loading...