Files
eternalwrt-mt798x/package/network/utils/xdp-tools/patches/0001-params-avoid-linux-if_ether.h-in-header-to-fix-musl-.patch
T

31 lines
860 B
Diff

From: Nick Hainke <vincent@systemli.org>
Subject: [PATCH] params: avoid linux/if_ether.h in header to fix musl build
On musl-based toolchains (e.g. MIPS), including <linux/if_ether.h>
from params.h triggers a chain through net/ethernet.h ->
netinet/if_ether.h which also defines struct ethhdr, causing a
redefinition conflict with the direct <linux/if_ether.h> include in
params.c.
params.h only uses ETH_ALEN from that header, so define it directly
to avoid the conflict.
Signed-off-by: Nick Hainke <vincent@systemli.org>
---
lib/util/params.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/lib/util/params.h
+++ b/lib/util/params.h
@@ -8,7 +8,9 @@
#include <stdlib.h>
#include <linux/in.h>
#include <linux/in6.h>
-#include <linux/if_ether.h>
+#ifndef ETH_ALEN
+#define ETH_ALEN 6
+#endif
#include <bpf/libbpf.h>
enum option_type {