python-pathvalidate: bump version to 0.14.1
[buildroot-gz.git] / package / babeld / 0001-kernel_netlink.c-don-t-include-linux-if_bridge.h.patch
blobefadd2038a6b8a21645edde295cbed19e210db2f
1 From 723bbfd8bdb76012a3da937c7499cf3c0b111dd5 Mon Sep 17 00:00:00 2001
2 From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
3 Date: Sat, 20 Aug 2016 11:13:56 +0200
4 Subject: [PATCH] kernel_netlink.c: don't include <linux/if_bridge.h>
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
9 Including <linux/if_bridge.h> causes the inclusion of <linux/in6.h>,
10 which defines 'struct in6_addr', also defined in <netinet/in.h>, causing
11 a build failure with the musl C library:
13 In file included from /home/thomas/projets/buildroot/output/host/usr/x86_64-buildroot-linux-musl/sysroot/usr/include/linux/if_bridge.h:18:0,
14 from kernel_netlink.c:42,
15 from kernel.c:31:
16 /home/thomas/projets/buildroot/output/host/usr/x86_64-buildroot-linux-musl/sysroot/usr/include/linux/in6.h:32:8: error: redefinition of ‘struct in6_addr’
17 struct in6_addr {
19 In file included from kernel_netlink.c:33:0,
20 from kernel.c:31:
21 /home/thomas/projets/buildroot/output/host/usr/x86_64-buildroot-linux-musl/sysroot/usr/include/netinet/in.h:23:8: note: originally defined here
22 struct in6_addr {
24 In file included from /home/thomas/projets/buildroot/output/host/usr/x86_64-buildroot-linux-musl/sysroot/usr/include/linux/if_bridge.h:18:0,
25 from kernel_netlink.c:42,
26 from kernel.c:31:
27 /home/thomas/projets/buildroot/output/host/usr/x86_64-buildroot-linux-musl/sysroot/usr/include/linux/in6.h:49:8: error: redefinition of ‘struct sockaddr_in6’
28 struct sockaddr_in6 {
30 In file included from kernel_netlink.c:33:0,
31 from kernel.c:31:
32 /home/thomas/projets/buildroot/output/host/usr/x86_64-buildroot-linux-musl/sysroot/usr/include/netinet/in.h:34:8: note: originally defined here
33 struct sockaddr_in6 {
35 In file included from /home/thomas/projets/buildroot/output/host/usr/x86_64-buildroot-linux-musl/sysroot/usr/include/linux/if_bridge.h:18:0,
36 from kernel_netlink.c:42,
37 from kernel.c:31:
38 /home/thomas/projets/buildroot/output/host/usr/x86_64-buildroot-linux-musl/sysroot/usr/include/linux/in6.h:59:8: error: redefinition of ‘struct ipv6_mreq’
39 struct ipv6_mreq {
41 In file included from kernel_netlink.c:33:0,
42 from kernel.c:31:
43 /home/thomas/projets/buildroot/output/host/usr/x86_64-buildroot-linux-musl/sysroot/usr/include/netinet/in.h:42:8: note: originally defined here
44 struct ipv6_mreq {
47 In order to address this, this patch removes the <linux/if_bridge.h>
48 inclusion, and instead defines BRCTL_GET_BRIDGES to the appropriate
49 value if it's not provided by the C library.
51 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
52 ---
53 kernel_netlink.c | 6 +++++-
54 1 file changed, 5 insertions(+), 1 deletion(-)
56 diff --git a/kernel_netlink.c b/kernel_netlink.c
57 index 4eadc39..1a5b3dd 100644
58 --- a/kernel_netlink.c
59 +++ b/kernel_netlink.c
60 @@ -39,10 +39,14 @@ THE SOFTWARE.
61 #include <sys/socket.h>
62 #include <linux/netlink.h>
63 #include <linux/rtnetlink.h>
64 -#include <linux/if_bridge.h>
65 #include <linux/fib_rules.h>
66 #include <net/if_arp.h>
68 +/* From <linux/if_bridge.h> */
69 +#ifndef BRCTL_GET_BRIDGES
70 +#define BRCTL_GET_BRIDGES 1
71 +#endif
73 #if(__GLIBC__ < 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ <= 5)
74 #define RTA_TABLE 15
75 #endif
76 --
77 2.7.4