]> git.openfabrics.org - ~aditr/compat.git/commitdiff
Mask proto_ports_offset if defined in kernel
authorVladimir Sokolovsky <vlad@mellanox.com>
Mon, 25 May 2015 07:36:03 +0000 (10:36 +0300)
committerVladimir Sokolovsky <vlad@mellanox.com>
Mon, 25 May 2015 07:36:03 +0000 (10:36 +0300)
Signed-off-by: Vladimir Sokolovsky <vlad@mellanox.com>
config/rdma.m4
include/linux/compat-2.6.37.h

index 1cd8351b5915356377bf29f9ca315fabba5d7678..436df2fa96cca494ae00420c974cb81fda12694b 100644 (file)
@@ -2125,6 +2125,20 @@ AC_DEFUN([LINUX_CONFIG_COMPAT],
                AC_MSG_RESULT(no)
        ])
 
+       AC_MSG_CHECKING([if in.h has proto_ports_offset])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/in.h>
+       ],[
+               int x = proto_ports_offset(IPPROTO_TCP);
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_PROTO_PORTS_OFFSET, 1,
+                         [proto_ports_offset is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
        LB_CHECK_SYMBOL_EXPORT([elfcorehdr_addr],
                [kernel/crash_dump.c],
                [AC_DEFINE(HAVE_ELFCOREHDR_ADDR_EXPORTED, 1,
index 17a978d482022acc297dd41cd1d4fdda762a28c7..e6db8be2025255452e3978fb6ea96abdc18ba46e 100644 (file)
@@ -12,6 +12,7 @@
 #include <linux/netdevice.h>
 #include <linux/errno.h>
 
+#ifndef HAVE_PROTO_PORTS_OFFSET
 static inline int proto_ports_offset(int proto)
 {
        switch (proto) {
@@ -28,6 +29,7 @@ static inline int proto_ports_offset(int proto)
                return -EINVAL;
        }
 }
+#endif
 
 /* supports eipoib flags, priv_flags is short till that version */
 #define CONFIG_COMPAT_IFF_EIPOIB_PIF 0x8000 /*== IFF_OVS_DATAPATH*/