Skip to contentSkip to conversation

include: uapi: netfilter_bridge.h: Cover for musl libc

PATCH Superseded Phil Sutter 1 participant 1 message Feb 11 netfilter

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Phil Sutter

author reviewer
#0 lore raw

PATCH 1/1 include: uapi: netfilter_bridge.h: Cover for musl libc

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.

---
 include/uapi/linux/netfilter_bridge.h | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
include/uapi/linux/netfilter_bridge.h +5 -4
index 1610fdbab98d..d4440e56da60 100644
@@ -5,16 +5,17 @@
 /* bridge-specific defines for netfilter. 
  */
 
+#ifndef __KERNEL__
+#include <limits.h>		/* for INT_MIN, INT_MAX */
+#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>
 #include <linux/if_vlan.h>
 #include <linux/if_pppox.h>
 
-#ifndef __KERNEL__
-#include <limits.h> /* for INT_MIN, INT_MAX */
-#endif
-
 /* Bridge Hooks */
 /* After promisc drops, checksum checks. */
 #define NF_BR_PRE_ROUTING	0
Signature · 1 line
2.51.0