[PATCH iproute2 net] iproute: fix compilation issue with older glibc

Subsystems: the rest

STALE3414d

3 messages, 3 authors, 2017-06-16 · open the first message on its own page

[PATCH iproute2 net] iproute: fix compilation issue with older glibc

From: David Lebrun <hidden>
Date: 2017-06-16 13:53:33

If a header that includes linux/in6.h is included before
iproute's utils.h, then iproute2 fails to compile on older
glibc versions.

Fixes: e8493916a8ede9970732e33ea52d30b83071f401 ("iproute: add support for SR-IPv6 lwtunnel encapsulation")
Reported-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David Lebrun <redacted>
---
 ip/iproute_lwtunnel.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/ip/iproute_lwtunnel.c b/ip/iproute_lwtunnel.c
index 1395f03..5c0c7d1 100644
--- a/ip/iproute_lwtunnel.c
+++ b/ip/iproute_lwtunnel.c
@@ -19,13 +19,6 @@
 #include <linux/ila.h>
 #include <linux/lwtunnel.h>
 #include <linux/mpls_iptunnel.h>
-
-#ifndef __USE_KERNEL_IPV6_DEFS
-#define __USE_KERNEL_IPV6_DEFS
-#endif
-#include <linux/seg6.h>
-#include <linux/seg6_iptunnel.h>
-#include <linux/seg6_hmac.h>
 #include <errno.h>
 
 #include "rt_names.h"
@@ -33,6 +26,10 @@
 #include "iproute_lwtunnel.h"
 #include "bpf_util.h"
 
+#include <linux/seg6.h>
+#include <linux/seg6_iptunnel.h>
+#include <linux/seg6_hmac.h>
+
 static const char *format_encap_type(int type)
 {
 	switch (type) {
-- 
2.10.2

Re: [PATCH iproute2 net] iproute: fix compilation issue with older glibc

From: Daniel Borkmann <daniel@iogearbox.net>
Date: 2017-06-16 14:48:28

On 06/16/2017 03:54 PM, David Lebrun wrote:
If a header that includes linux/in6.h is included before
iproute's utils.h, then iproute2 fails to compile on older
glibc versions.

Fixes: e8493916a8ede9970732e33ea52d30b83071f401 ("iproute: add support for SR-IPv6 lwtunnel encapsulation")
Reported-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David Lebrun <redacted>
Works for me, thanks for fixing! ;)

Tested-by: Daniel Borkmann <daniel@iogearbox.net>

Re: [PATCH iproute2 net] iproute: fix compilation issue with older glibc

From: Stephen Hemminger <stephen@networkplumber.org>
Date: 2017-06-16 16:04:41

On Fri, 16 Jun 2017 15:54:28 +0200
David Lebrun [off-list ref] wrote:
If a header that includes linux/in6.h is included before
iproute's utils.h, then iproute2 fails to compile on older
glibc versions.

Fixes: e8493916a8ede9970732e33ea52d30b83071f401 ("iproute: add support for SR-IPv6 lwtunnel encapsulation")
Reported-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David Lebrun <redacted>
Looks good, almost always best to remove #ifdef's if possible.
Applied
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help