compat: Detect and use nf_connlabels_get().
authorJoe Stringer <joe@ovn.org>
Thu, 24 Dec 2015 19:34:35 +0000 (11:34 -0800)
committerJoe Stringer <joe@ovn.org>
Tue, 2 Feb 2016 22:26:46 +0000 (14:26 -0800)
Signed-off-by: Joe Stringer <joe@ovn.org>
Acked-by: Pravin B Shelar <pshelar@ovn.org>
acinclude.m4
datapath/linux/compat/include/net/netfilter/nf_conntrack_labels.h

index 6b57403..54c6e72 100644 (file)
@@ -396,6 +396,8 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [
                   [OVS_DEFINE([HAVE_NF_CT_TMPL_ALLOC_TAKES_STRUCT_ZONE])])
   OVS_GREP_IFELSE([$KSRC/include/net/netfilter/nf_conntrack_zones.h],
                   [nf_ct_zone_init])
+  OVS_GREP_IFELSE([$KSRC/include/net/netfilter/nf_conntrack_labels.h],
+                  [nf_connlabels_get])
 
   OVS_GREP_IFELSE([$KSRC/include/linux/random.h], [prandom_u32])
   OVS_GREP_IFELSE([$KSRC/include/linux/random.h], [prandom_u32_max])
index 88413e7..a594a0f 100644 (file)
@@ -5,7 +5,7 @@
 #include <linux/version.h>
 #include_next <net/netfilter/nf_conntrack_labels.h>
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4,3,0)
+#ifndef HAVE_NF_CONNLABELS_GET
 #if IS_ENABLED(CONFIG_NF_CONNTRACK_LABELS)
 
 #ifndef NF_CT_LABELS_MAX_SIZE
@@ -45,5 +45,5 @@ static inline int nf_connlabels_get(struct net *net, unsigned int n_bits)
 
 static inline void nf_connlabels_put(struct net *net) { }
 #endif /* CONFIG_NF_CONNTRACK_LABELS */
-#endif /* 4.3 */
+#endif /* HAVE_NF_CONNLABELS_GET */
 #endif /* _NF_CONNTRACK_LABELS_WRAPPER_H */