netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] ipv6: sr: fix user space compilation error with old glibc
@ 2017-05-15  9:18 David Lebrun
  2017-05-15 10:05 ` Daniel Borkmann
  0 siblings, 1 reply; 6+ messages in thread
From: David Lebrun @ 2017-05-15  9:18 UTC (permalink / raw)
  To: netdev; +Cc: daniel, David Lebrun

When seg6.h is included in a user space program that also includes
netinet/in.h, it results in multiple definitions of structures such as
struct in6_addr. Recent glibc versions have a workaround that consists in
defining __USE_KERNEL_IPV6_DEFS to prevent duplicates. However, such a
program will fail to compile with older glibc versions.

This patch ensures that including seg6.h will work in any case.

Fixes: ea3ebc73b46fbdb049dafd47543bb22efaa09c8e ("uapi: fix linux/seg6.h and linux/seg6_iptunnel.h userspace compilation errors")
Reported-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David Lebrun <david.lebrun@uclouvain.be>
---
 include/uapi/linux/seg6.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/include/uapi/linux/seg6.h b/include/uapi/linux/seg6.h
index 7278511..52b8f46 100644
--- a/include/uapi/linux/seg6.h
+++ b/include/uapi/linux/seg6.h
@@ -15,7 +15,16 @@
 #define _UAPI_LINUX_SEG6_H
 
 #include <linux/types.h>
+
+#ifdef __KERNEL__
 #include <linux/in6.h>		/* For struct in6_addr. */
+#else
+#ifdef __USE_KERNEL_IPV6_DEFS
+#include <linux/in6.h>
+#else
+#include <netinet/in.h>
+#endif
+#endif
 
 /*
  * SRH
-- 
2.10.2

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-05-15 11:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-15  9:18 [PATCH net] ipv6: sr: fix user space compilation error with old glibc David Lebrun
2017-05-15 10:05 ` Daniel Borkmann
2017-05-15 10:37   ` David Lebrun
2017-05-15 10:43     ` Daniel Borkmann
2017-05-15 10:53       ` David Lebrun
2017-05-15 11:01         ` David Lebrun

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).