Skip to contentSkip to conversation

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

PATCH New Phil Sutter 1 participant 1 message Feb 14 netfilter

lore
Share & tools
lore

Phil Sutter

author reviewer
#0 lore raw

PATCH v2 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.

---
Changes since v1:
- Adjust to previously applied 0b3877bec78b ("netfilter: uapi: Use UAPI definition of INT_MAX and INT_MIN")

---
 include/uapi/linux/netfilter_bridge.h | 4 ++++
 1 file changed, 4 insertions(+)
include/uapi/linux/netfilter_bridge.h +4 -0
index f6e8d1e05c97..758de72b2764 100644
@@ -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>
Signature · 1 line
2.51.0