Skip to content
/ linux Public

Commit 44373b1

Browse files
Phil SutterSasha Levin
authored andcommitted
include: uapi: netfilter_bridge.h: Cover for musl libc
[ Upstream commit 4edd4ba ] Musl defines its own struct ethhdr and thus defines __UAPI_DEF_ETHHDR to zero. To avoid struct redefinition errors, user space is therefore supposed to include netinet/if_ether.h before (or instead of) linux/if_ether.h. To relieve them from this burden, include the libc header here if not building for kernel space. Reported-by: Alyssa Ross <hi@alyssa.is> Suggested-by: Florian Westphal <fw@strlen.de> Signed-off-by: Phil Sutter <phil@nwl.cc> Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 9f33e83 commit 44373b1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

include/uapi/linux/netfilter_bridge.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
/* bridge-specific defines for netfilter.
66
*/
77

8+
#ifndef __KERNEL__
9+
#include <netinet/if_ether.h> /* for __UAPI_DEF_ETHHDR if defined */
10+
#endif
11+
812
#include <linux/in.h>
913
#include <linux/netfilter.h>
1014
#include <linux/if_ether.h>

0 commit comments

Comments
 (0)