]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
include: uapi: netfilter_bridge.h: Cover for musl libc
authorPhil Sutter <phil@nwl.cc>
Sat, 14 Feb 2026 14:54:06 +0000 (15:54 +0100)
committerSasha Levin <sashal@kernel.org>
Wed, 4 Mar 2026 12:20:45 +0000 (07:20 -0500)
[ Upstream commit 4edd4ba71ce0df015303dba75ea9d20d1a217546 ]

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>
include/uapi/linux/netfilter_bridge.h

index 1610fdbab98dfc89212ee653a573da8c39bdefe8..ad520d3e9df8f76ba4ce38837ef46ee7dc12e26d 100644 (file)
@@ -5,6 +5,10 @@
 /* bridge-specific defines for netfilter. 
  */
 
+#ifndef __KERNEL__
+#include <netinet/if_ether.h>  /* for __UAPI_DEF_ETHHDR if defined */
+#endif
+
 #include <linux/in.h>
 #include <linux/netfilter.h>
 #include <linux/if_ether.h>