diff mbox series

[xtables] ebtables: vlan: fix userspace/kernel headers collision

Message ID 49cd8eb7f23bc5df4c807be3281ea3e19533b8e3.1542129728.git.baruch@tkos.co.il
State Accepted
Delegated to: Pablo Neira
Headers show
Series [xtables] ebtables: vlan: fix userspace/kernel headers collision | expand

Commit Message

Baruch Siach Nov. 13, 2018, 5:22 p.m. UTC
Build with musl libc fails because of conflicting struct ethhdr
definitions:

In file included from .../sysroot/usr/include/net/ethernet.h:10:0,
                 from ../iptables/nft-bridge.h:8,
                 from libebt_vlan.c:18:
.../sysroot/usr/include/netinet/if_ether.h:107:8: error: redefinition of ‘struct ethhdr’
 struct ethhdr {
        ^~~~~~
In file included from libebt_vlan.c:16:0:
.../sysroot/usr/include/linux/if_ether.h:160:8: note: originally defined here
 struct ethhdr {
        ^~~~~~

Include the userspace header first for the definition suppression logic
to do the right thing.

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
---
 extensions/libebt_vlan.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Pablo Neira Ayuso Nov. 13, 2018, 8:12 p.m. UTC | #1
On Tue, Nov 13, 2018 at 07:22:08PM +0200, Baruch Siach wrote:
> Build with musl libc fails because of conflicting struct ethhdr
> definitions:
> 
> In file included from .../sysroot/usr/include/net/ethernet.h:10:0,
>                  from ../iptables/nft-bridge.h:8,
>                  from libebt_vlan.c:18:
> .../sysroot/usr/include/netinet/if_ether.h:107:8: error: redefinition of ‘struct ethhdr’
>  struct ethhdr {
>         ^~~~~~
> In file included from libebt_vlan.c:16:0:
> .../sysroot/usr/include/linux/if_ether.h:160:8: note: originally defined here
>  struct ethhdr {
>         ^~~~~~
> 
> Include the userspace header first for the definition suppression logic
> to do the right thing.

Applied, thanks.
diff mbox series

Patch

diff --git a/extensions/libebt_vlan.c b/extensions/libebt_vlan.c
index 4a2eb7126895..be269c6cdb4c 100644
--- a/extensions/libebt_vlan.c
+++ b/extensions/libebt_vlan.c
@@ -12,6 +12,7 @@ 
 #include <getopt.h>
 #include <ctype.h>
 #include <xtables.h>
+#include <netinet/if_ether.h>
 #include <linux/netfilter_bridge/ebt_vlan.h>
 #include <linux/if_ether.h>
 #include "iptables/nft.h"