[ovs-dev] [PATCH] datapath: Correct version check for genetlink net namespaces.

Jesse Gross jesse at nicira.com
Sun Jan 30 21:29:50 UTC 2011


Network namespaces were introduced in 2.6.24, not 2.6.19 as some of the
version checks were looking for.  This caused compile errors in that
kernel range when the functions couldn't be found.  In addition,
namespace support wasn't initially available in Netlink so the netns
headers weren't included, causing compile problems for a few more
kernels.

Reported-by: Justin Pettit <jpettit at nicira.com>
Signed-off-by: Jesse Gross <jesse at nicira.com>
---
I don't have a kernel in this range currently checked out.  Justin, can
you please test this?
---
 .../linux-2.6/compat-2.6/include/net/genetlink.h   |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/datapath/linux-2.6/compat-2.6/include/net/genetlink.h b/datapath/linux-2.6/compat-2.6/include/net/genetlink.h
index 37b25b2..c91408e 100644
--- a/datapath/linux-2.6/compat-2.6/include/net/genetlink.h
+++ b/datapath/linux-2.6/compat-2.6/include/net/genetlink.h
@@ -3,6 +3,7 @@
 
 #include <linux/version.h>
 #include <linux/netlink.h>
+#include <net/net_namespace.h>
 
 /* Very special super-nasty workaround here:
  *
@@ -152,14 +153,14 @@ int genl_register_family_with_ops(struct genl_family *family,
 	struct genl_ops *ops, size_t n_ops);
 #endif
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
 #define genl_notify(skb, net, pid, group, nlh, flags) \
 	genl_notify(skb, pid, group, nlh, flags)
 #endif
 extern void genl_notify(struct sk_buff *skb, struct net *net, u32 pid,
 			u32 group, struct nlmsghdr *nlh, gfp_t flags);
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19) && \
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24) && \
     LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)
 static inline struct net *genl_info_net(struct genl_info *info)
 {
-- 
1.7.1





More information about the dev mailing list