]> git.ipfire.org Git - thirdparty/hostap.git/commit
vlan: Fix musl libc conflict with Linux kernel headers
authorJörg Krause <joerg.krause@embedded.rocks>
Tue, 8 Mar 2016 20:42:30 +0000 (21:42 +0100)
committerJouni Malinen <j@w1.fi>
Sat, 26 Mar 2016 09:02:16 +0000 (11:02 +0200)
commit81606ab73bff3c402d03a60b590b4e723d8e12c1
treee00957fd63214d989f97759e6a59476a9872146e
parentf347429cf160140b74a1b2f1af0e506bd52c91ba
vlan: Fix musl libc conflict with Linux kernel headers

Due to both <netinet/in.h> (in "utils/includes.h") and <linux/in6.h> (in
<linux/if_bridge.h>) being included, the in6_addr is being redefined:
once from the C library headers and once from the Linux kernel headers.
This causes some build failures with for example the musl C library:

In file included from /usr/include/linux/if_bridge.h:18,
                 from ../src/ap/vlan_init.c:17:
/usr/include/linux/in6.h:32: error: redefinition of 'struct in6_addr'
/usr/include/linux/in6.h:49: error: redefinition of 'struct sockaddr_in6'
/usr/include/linux/in6.h:59: error: redefinition of 'struct ipv6_mreq'

Mixing C library and Linux kernel headers is a bit problematic [1] and
should be avoided if possible [2]. In order to fix this, define just the
macros needed from <linux/if_bridge.h> as done in Busybox for the brctl
applet [3].

[1] https://sourceware.org/bugzilla/show_bug.cgi?id=15850
[2] http://www.openwall.com/lists/musl/2015/10/06/1
[3] https://git.busybox.net/busybox/commit/?id=5fa6d1a632505789409a2ba6cf8e112529f9db18

Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
src/ap/vlan_full.c