datapath: check for backported proto_ports_offset
authorFlavio Leitner <fbl@redhat.com>
Fri, 28 Aug 2015 13:37:09 +0000 (10:37 -0300)
committerJesse Gross <jesse@nicira.com>
Fri, 28 Aug 2015 16:44:48 +0000 (09:44 -0700)
Red Hat Enterprise Linux 6 has backported it from upstream,
so check for proto_ports_offset instead of kernel version.

Signed-off-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
acinclude.m4
datapath/linux/compat/include/linux/in.h

index db0de0d..5e34d92 100644 (file)
@@ -324,6 +324,7 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [
   OVS_GREP_IFELSE([$KSRC/include/linux/if_vlan.h], [vlan_set_encap_proto])
 
   OVS_GREP_IFELSE([$KSRC/include/linux/in.h], [ipv4_is_multicast])
+  OVS_GREP_IFELSE([$KSRC/include/linux/in.h], [proto_ports_offset])
   OVS_GREP_IFELSE([$KSRC/include/net/ip.h], [__ip_select_ident.*dst_entry],
                   [OVS_DEFINE([HAVE_IP_SELECT_IDENT_USING_DST_ENTRY])])
   OVS_GREP_IFELSE([$KSRC/include/net/ip.h], [inet_get_local_port_range.*net],
index fa2e026..78f8d77 100644 (file)
@@ -4,7 +4,7 @@
 #include_next <linux/in.h>
 
 #include <linux/module.h>
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)
+#ifndef HAVE_PROTO_PORTS_OFFSET
 static inline int proto_ports_offset(int proto)
 {
        switch (proto) {