datapath: Correct version check for genetlink net namespaces.
authorJesse Gross <jesse@nicira.com>
Sun, 30 Jan 2011 21:05:33 +0000 (13:05 -0800)
committerJesse Gross <jesse@nicira.com>
Sun, 30 Jan 2011 21:27:03 +0000 (13:27 -0800)
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@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
datapath/linux-2.6/compat-2.6/include/net/genetlink.h

index 37b25b2..c91408e 100644 (file)
@@ -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)
 {