From aba736dc251ee7aa7c2035e18bffc37b18f05222 Mon Sep 17 00:00:00 2001 From: Leon Romanovsky Date: Mon, 13 Nov 2017 12:21:19 +0200 Subject: [PATCH 1/3] ip: Fix compilation break on old systems MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As was reported [1], the iproute2 fails to compile on old systems, in Cong's case, it was Fedora 19, in our case it was RedHat 7.2, which failed with the following errors during compilation: ipxfrm.c: In function ‘xfrm_selector_print’: ipxfrm.c:479:7: error: ‘IPPROTO_MH’ undeclared (first use in this function) case IPPROTO_MH: ^ ipxfrm.c:479:7: note: each undeclared identifier is reported only once for each function it appears in ipxfrm.c: In function ‘xfrm_selector_upspec_parse’: ipxfrm.c:1345:8: error: ‘IPPROTO_MH’ undeclared (first use in this function) case IPPROTO_MH: ^ make[1]: *** [ipxfrm.o] Error 1 The reason to it is the order of headers files. The IPPROTO_MH field is set in kernel's UAPI header file (in6.h), but only in case __UAPI_DEF_IPPROTO_V6 is set before. That define comes from other kernel's header file (libc-compat.h) and is set in case there are no previous libc relevant declarations. In ip code, the include of causes to indirect inclusion of and it sets __UAPI_DEF_IPPROTO_V6 to be zero and prevents from IPPROTO_MH declaration. This patch takes the simplest possible approach to fix the compilation error by checking if IPPROTO_MH was defined before and in case it wasn't, it defines it to be the same as in the kernel. [1] https://www.spinics.net/lists/netdev/msg463980.html Cc: Cong Wang Cc: Riad Abo Raed Signed-off-by: Leon Romanovsky --- ip/xfrm.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ip/xfrm.h b/ip/xfrm.h index 8566d639f..71be574d9 100644 --- a/ip/xfrm.h +++ b/ip/xfrm.h @@ -30,6 +30,10 @@ #include #include +#ifndef IPPROTO_MH +#define IPPROTO_MH 135 +#endif + #define XFRMS_RTA(x) ((struct rtattr*)(((char*)(x)) + NLMSG_ALIGN(sizeof(struct xfrm_usersa_info)))) #define XFRMS_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct xfrm_usersa_info)) From b867d46dafee4ac81acecd2d398c392eb43b50bb Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Mon, 13 Nov 2017 10:08:39 -0800 Subject: [PATCH 2/3] utils: remove duplicate include of ctype.h Signed-off-by: Stephen Hemminger --- lib/utils.c | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/utils.c b/lib/utils.c index f77be1fda..c102add77 100644 --- a/lib/utils.c +++ b/lib/utils.c @@ -31,7 +31,6 @@ #include #include #include -#include #include "rt_names.h" #include "utils.h" From 212b52299e90a369373b9e38924b9492df695559 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Mon, 13 Nov 2017 10:09:57 -0800 Subject: [PATCH 3/3] v4.14.1 --- include/SNAPSHOT.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/SNAPSHOT.h b/include/SNAPSHOT.h index 2ef4ecae8..576b11a6f 100644 --- a/include/SNAPSHOT.h +++ b/include/SNAPSHOT.h @@ -1 +1 @@ -static const char SNAPSHOT[] = "171112"; +static const char SNAPSHOT[] = "171113";