From d196c4249f5663d75349a79cfdd87e27df223aac Mon Sep 17 00:00:00 2001 From: Vladimir Sokolovsky Date: Mon, 25 May 2015 10:36:03 +0300 Subject: [PATCH] Mask proto_ports_offset if defined in kernel Signed-off-by: Vladimir Sokolovsky --- config/rdma.m4 | 14 ++++++++++++++ include/linux/compat-2.6.37.h | 2 ++ 2 files changed, 16 insertions(+) diff --git a/config/rdma.m4 b/config/rdma.m4 index 1cd8351..436df2f 100644 --- a/config/rdma.m4 +++ b/config/rdma.m4 @@ -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 + ],[ + 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, diff --git a/include/linux/compat-2.6.37.h b/include/linux/compat-2.6.37.h index 17a978d..e6db8be 100644 --- a/include/linux/compat-2.6.37.h +++ b/include/linux/compat-2.6.37.h @@ -12,6 +12,7 @@ #include #include +#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*/ -- 2.41.0