Kernels 3.17 and older have this field, while newer kernels use the
'flags' field. Detect this in the build in case anyone backports this
change to an older kernel.

Signed-off-by: Joe Stringer <j...@ovn.org>
---
 acinclude.m4                                  | 3 +++
 datapath/linux/compat/include/net/inet_frag.h | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/acinclude.m4 b/acinclude.m4
index 9d652c2aed13..b78244d6bf4f 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -352,6 +352,9 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [
   OVS_GREP_IFELSE([$KSRC/include/net/ip.h], [ip_skb_dst_mtu])
   OVS_GREP_IFELSE([$KSRC/include/net/inet_frag.h], [hashfn.*const],
                   [OVS_DEFINE([HAVE_INET_FRAGS_CONST])])
+  OVS_GREP_IFELSE([$KSRC/include/net/inet_frag.h], [last_in],
+                  [OVS_DEFINE([HAVE_INET_FRAGS_LAST_IN])])
+
   OVS_GREP_IFELSE([$KSRC/include/net/dst_metadata.h], [metadata_dst])
 
   OVS_GREP_IFELSE([$KSRC/include/linux/net.h], [sock_create_kern.*net],
diff --git a/datapath/linux/compat/include/net/inet_frag.h 
b/datapath/linux/compat/include/net/inet_frag.h
index 6e98ebc6990f..0c0c07619126 100644
--- a/datapath/linux/compat/include/net/inet_frag.h
+++ b/datapath/linux/compat/include/net/inet_frag.h
@@ -14,7 +14,7 @@
 #endif
 
 #ifdef OVS_FRAGMENT_BACKPORT
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3,17,0)
+#ifdef HAVE_INET_FRAGS_LAST_IN
 #define q_flags(q) (q->last_in)
 #define qp_flags(qp) (qp->q.last_in)
 #else
-- 
2.1.4

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to