compat: Detect and use inet_frag_queue->last_in.
authorJoe Stringer <joe@ovn.org>
Thu, 24 Dec 2015 18:40:02 +0000 (10:40 -0800)
committerJoe Stringer <joe@ovn.org>
Tue, 2 Feb 2016 22:26:45 +0000 (14:26 -0800)
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 <joe@ovn.org>
Acked-by: Pravin B Shelar <pshelar@ovn.org>
acinclude.m4
datapath/linux/compat/include/net/inet_frag.h

index c5a1c44..e99ab01 100644 (file)
@@ -353,6 +353,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],
index 6e98ebc..0c0c076 100644 (file)
@@ -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