new file mode 100644
@@ -0,0 +1,39 @@
+From 5ab64f7e08ea0325d83d446dd4015f82b4c179dd Mon Sep 17 00:00:00 2001
+From: Chen Qi <Qi.Chen@windriver.com>
+Date: Mon, 29 Sep 2025 21:39:01 +0800
+Subject: [PATCH] include/netinet/if_ether.h: define __UAPI_DEF_ETHHDR early
+
+After 'struct ethhdr' is defined, we should immediately define
+__UAPI_DEF_ETHHDR. Because the following lines are header inclusion
+lines which might introduce header files checking __UAPI_DEF_ETHHDR.
+If we don't define this macro early, we will get redefinition error.
+
+Upstream-Status: Submitted [https://www.openwall.com/lists/musl/2025/09/30/1]
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ include/netinet/if_ether.h | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/include/netinet/if_ether.h b/include/netinet/if_ether.h
+index 3479f511..b1646f6f 100644
+--- a/include/netinet/if_ether.h
++++ b/include/netinet/if_ether.h
+@@ -117,6 +117,7 @@ struct ethhdr {
+ uint8_t h_source[ETH_ALEN];
+ uint16_t h_proto;
+ };
++#define __UAPI_DEF_ETHHDR 0
+
+ #include <net/ethernet.h>
+ #include <net/if_arp.h>
+@@ -144,6 +145,4 @@ do { \
+ (enaddr)[5] = ((uint8_t *)ipaddr)[3]; \
+ } while(0)
+
+-#define __UAPI_DEF_ETHHDR 0
+-
+ #endif
+--
+2.34.1
+
new file mode 100644
@@ -0,0 +1,39 @@
+From 67976391887c3c65138a3b6fc306f2f5b490aeb4 Mon Sep 17 00:00:00 2001
+From: Chen Qi <Qi.Chen@windriver.com>
+Date: Tue, 30 Sep 2025 10:42:51 +0800
+Subject: [PATCH] include/netinet/if_ether.h: guard ethhdr definition to better
+ work with other header files
+
+The unconditional definition of 'struct ethhdr' has the implicit
+requirement on this header file, that is, it needs to be included
+before other header files defining ethhdr.
+
+Upstream-Status: Submitted [https://www.openwall.com/lists/musl/2025/09/30/2]
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ include/netinet/if_ether.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/include/netinet/if_ether.h b/include/netinet/if_ether.h
+index b1646f6f..e5a1ebd0 100644
+--- a/include/netinet/if_ether.h
++++ b/include/netinet/if_ether.h
+@@ -112,12 +112,14 @@
+ #define ETH_P_XDSA 0x00F8
+ #define ETH_P_MAP 0x00F9
+
++#ifndef __UAPI_DEF_ETHHDR
+ struct ethhdr {
+ uint8_t h_dest[ETH_ALEN];
+ uint8_t h_source[ETH_ALEN];
+ uint16_t h_proto;
+ };
+ #define __UAPI_DEF_ETHHDR 0
++#endif
+
+ #include <net/ethernet.h>
+ #include <net/if_arp.h>
+--
+2.34.1
+
@@ -14,6 +14,8 @@ SRC_URI = "git://git.musl-libc.org/musl;branch=master \
file://0001-Make-dynamic-linker-a-relative-symlink-to-libc.patch \
file://0002-ldso-Use-syslibdir-and-libdir-as-default-pathes-to-l.patch \
file://0001-Update-syscalls-for-r32-rv64-from-kernel-6.4-through.patch \
+ file://0001-include-netinet-if_ether.h-define-__UAPI_DEF_ETHHDR-.patch \
+ file://0001-include-netinet-if_ether.h-guard-ethhdr-definition-t.patch \
"
PROVIDES += "virtual/libc virtual/libiconv virtual/libintl virtual/crypt"