[ovs-dev] [PATCH 3/5] datapath: check for backported ip_is_fragment

Flavio Leitner fbl at redhat.com
Fri Aug 28 13:37:10 UTC 2015


Red Hat Enterprise Linux 6 has backported it from upstream,
so check for ip_is_fragment instead of kernel version.

Signed-off-by: Flavio Leitner <fbl at redhat.com>
---
 acinclude.m4                           | 1 +
 datapath/linux/compat/include/net/ip.h | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/acinclude.m4 b/acinclude.m4
index 5e34d92..6e28788 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -329,6 +329,7 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [
                   [OVS_DEFINE([HAVE_IP_SELECT_IDENT_USING_DST_ENTRY])])
   OVS_GREP_IFELSE([$KSRC/include/net/ip.h], [inet_get_local_port_range.*net],
                   [OVS_DEFINE([HAVE_INET_GET_LOCAL_PORT_RANGE_USING_NET])])
+  OVS_GREP_IFELSE([$KSRC/include/net/ip.h], [ip_is_fragment])
 
   OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h], [dev_disable_lro])
   OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h], [dev_get_stats])
diff --git a/datapath/linux/compat/include/net/ip.h b/datapath/linux/compat/include/net/ip.h
index b606177..a9401a7 100644
--- a/datapath/linux/compat/include/net/ip.h
+++ b/datapath/linux/compat/include/net/ip.h
@@ -5,7 +5,7 @@
 
 #include <linux/version.h>
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0)
+#ifndef HAVE_IP_IS_FRAGMENT
 static inline bool ip_is_fragment(const struct iphdr *iph)
 {
 	return (iph->frag_off & htons(IP_MF | IP_OFFSET)) != 0;
-- 
2.1.0




More information about the dev mailing list