iproute2 build error due to sr-ipv6 lwtunnel
Subsystems (3)
Hi David,
I'm getting the following build error from e8493916a8ed ("iproute:
add support for SR-IPv6 lwtunnel encapsulation"). Reverting your commit makes iproute2 build again for me. Please take a look.
[...]
CC iplink_vrf.o
CC iproute_lwtunnel.o
In file included from ../include/linux/seg6.h:18:0,
from iproute_lwtunnel.c:26:../include/linux/in6.h:131:26: error: expected identifier before numeric constant
#define IPPROTO_HOPOPTS 0 /* IPv6 hop-by-hop options */
^
In file included from /usr/include/resolv.h:57:0,
from ../include/utils.h:6,
from iproute_lwtunnel.c:32:
/usr/include/netinet/in.h:196:8: error: redefinition of ‘struct in6_addr’
struct in6_addr
^
In file included from ../include/linux/seg6.h:18:0,
from iproute_lwtunnel.c:26:
../include/linux/in6.h:32:8: note: originally defined here
struct in6_addr {
^
In file included from /usr/include/resolv.h:57:0,
from ../include/utils.h:6,
from iproute_lwtunnel.c:32:
/usr/include/netinet/in.h:237:8: error: redefinition of ‘struct sockaddr_in6’
struct sockaddr_in6
^
In file included from ../include/linux/seg6.h:18:0,
from iproute_lwtunnel.c:26:
../include/linux/in6.h:49:8: note: originally defined here
struct sockaddr_in6 {
^
In file included from /usr/include/resolv.h:57:0,
from ../include/utils.h:6,
from iproute_lwtunnel.c:32:
/usr/include/netinet/in.h:273:8: error: redefinition of ‘struct ipv6_mreq’
struct ipv6_mreq
^
In file included from ../include/linux/seg6.h:18:0,
from iproute_lwtunnel.c:26:
../include/linux/in6.h:59:8: note: originally defined here
struct ipv6_mreq {
^iproute_lwtunnel.c: In function ‘parse_encap_seg6’:
iproute_lwtunnel.c:375:3: warning: passing argument 3 of ‘inet_get_addr’ from incompatible pointer type [enabled by default]
inet_get_addr(s, NULL, &srh->segments[i]);
^
In file included from iproute_lwtunnel.c:32:0:../include/utils.h:241:5: note: expected ‘struct in6_addr *’ but argument is of type ‘struct in6_addr *’
int inet_get_addr(const char *src, __u32 *dst, struct in6_addr *dst6);
^make[1]: *** [iproute_lwtunnel.o] Error 1
make: *** [all] Error 2
[root@localhost iproute]#
Thanks,
Daniel
Quoted 5 lines · Daniel Borkmann
Hi David,
I'm getting the following build error from
e8493916a8ed("iproute:
add support for SR-IPv6 lwtunnel encapsulation"). Reverting your commit makes iproute2 build again for me. Please take a look.
Hi Daniel,
This is because linux/seg6.h does an include of linux/in6.h (cf kernel commit ea3ebc73b46fbdb049dafd47543bb22efaa09c8e "uapi: fix linux/seg6.h and linux/seg6_iptunnel.h userspace compilation errors"), and iproute2's include/utils.h requires the system /usr/include/resolv.h, which itself includes /usr/include/netinet/in.h, re-defining struct in6_addr.
However, netinet/in.h protects some struct definitions with #ifndef __USE_KERNEL_IPV6_DEFS, which is explicitly defined in iproute_lwtunnel.c, thus avoiding this specific issue.
What is your glibc version ?
David
Quoted 15 lines · David Lebrun
Quoted 5 lines · Daniel Borkmann
Hi David,
I'm getting the following build error from
e8493916a8ed("iproute:
add support for SR-IPv6 lwtunnel encapsulation"). Reverting your commit makes iproute2 build again for me. Please take a look.Hi Daniel,
This is because
linux/seg6.hdoes an include oflinux/in6.h(cf kernel commitea3ebc73b46fbdb049dafd47543bb22efaa09c8e"uapi: fixlinux/seg6.handlinux/seg6_iptunnel.huserspace compilation errors"), and iproute2'sinclude/utils.hrequires the system/usr/include/resolv.h, which itself includes/usr/include/netinet/in.h, re-defining structin6_addr.
Quoted 5 lines
However,
netinet/in.hprotects some struct definitions with #ifndef__USE_KERNEL_IPV6_DEFS, which is explicitly defined iniproute_lwtunnel.c, thus avoiding this specific issue.What is your glibc version ?
Ok, I see, on one of my machines I have an old user space, but latest net/net-next kernel (+ installed kernel headers) and iproute2. glibc version there is 2.18.
Quoted 20 lines · Daniel Borkmann
Quoted 19 lines · David Lebrun
Quoted 5 lines · Daniel Borkmann
Hi David,
I'm getting the following build error from
e8493916a8ed("iproute:
add support for SR-IPv6 lwtunnel encapsulation"). Reverting your commit makes iproute2 build again for me. Please take a look.Hi Daniel,
This is because
linux/seg6.hdoes an include oflinux/in6.h(cf kernel commitea3ebc73b46fbdb049dafd47543bb22efaa09c8e"uapi: fixlinux/seg6.handlinux/seg6_iptunnel.huserspace compilation errors"), and iproute2'sinclude/utils.hrequires the system/usr/include/resolv.h, which itself includes/usr/include/netinet/in.h, re-defining structin6_addr.However,
netinet/in.hprotects some struct definitions with #ifndef__USE_KERNEL_IPV6_DEFS, which is explicitly defined iniproute_lwtunnel.c, thus avoiding this specific issue.
Quoted 5 lines
Quoted 1 line
What is your glibc version ?
Ok, I see, on one of my machines I have an old user space, but latest
net/net-nextkernel (+ installed kernel headers) and iproute2. glibc version there is 2.18.
David, are you still looking into fixing this?
Quoted 2 lines · Daniel Borkmann
David, are you still looking into fixing this?
Sorry, I left the issue on the side and then forgot about it.
Could you try the following iproute2 patch ? Thanks
include/linux/seg6.h +5 -0
@@ -15,7 +15,12 @@#define _LINUX_SEG6_H#include <linux/types.h> + +#ifdef __KERNEL__#include <linux/in6.h> /* For struct in6_addr. */ +#else +#include <netinet/in.h> +#endif /* * SRH
ip/iproute_lwtunnel.c +0 -3
@@ -20,9 +20,6 @@#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>
Quoted 7 lines · David Lebrun
Quoted 2 lines · Daniel Borkmann
David, are you still looking into fixing this?
Sorry, I left the issue on the side and then forgot about it.
Could you try the following iproute2 patch ? Thanks
Yep, that compiles fine for me, thanks!
Quoted 7 lines · On Mon, 15 May 2017 09:56:18 +0200 David Lebrun <[email protected]>…
Quoted 2 lines · Daniel Borkmann
David, are you still looking into fixing this?
Sorry, I left the issue on the side and then forgot about it.
Could you try the following iproute2 patch ? Thanks
The headers in iproute2 come from kernel headers.
Any changes need to be done upstream in kernel.