summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--system/easy-kernel/APKBUILD4
-rw-r--r--system/easy-kernel/uapi-iphdr.patch47
-rw-r--r--system/musl/APKBUILD2
-rw-r--r--system/musl/uapi-iphdr.patch30
4 files changed, 82 insertions, 1 deletions
diff --git a/system/easy-kernel/APKBUILD b/system/easy-kernel/APKBUILD
index 640caa7cb..29805f75b 100644
--- a/system/easy-kernel/APKBUILD
+++ b/system/easy-kernel/APKBUILD
@@ -31,6 +31,7 @@ source="https://cdn.kernel.org/pub/linux/kernel/v${_pkgmajver}.x/linux-${_pkgmin
config-sparc64
config-m68k
kernel.h
+ uapi-iphdr.patch
"
builddir="$srcdir/linux-${_pkgminver}"
@@ -136,4 +137,5 @@ ec86baafbfc22fdb08872276284eac7dce695c192a02c3b7d35a5d67861b98be18475ccfbb366ff9
baefddb2e1de0105f9333702121d3dd2c1f1d54ce22ee7f7d3a54d4fa1028e9b5dadeecb6cca8a717d30c7bc083daa652b0281fb1b39a85f191954ac5a95fecd config-aarch64
430d968f60cfd33d3ba1e7c2fec8b1d1eedee8086c7cebebf162223b058b0e1d873033e46e05f63d8a50c61397eaf1036b1e4b3a60581f08c6482810aa25df7f config-sparc64
1b99310e2de81267fdb1668ad6f52f26d8798d94c0a952cfe9992ff40e5d7331ddfb324b8f99bfa300240aa568bbd4525150e0c774c797d85756714163fd0fa5 config-m68k
-61dcd633d72876566b7738dd08856b26850c935b4a81ab2364711335fe01c397083160f530b3382bbc239c6a8135be6a032e93039083ec2cefdae2902429a2e0 kernel.h"
+61dcd633d72876566b7738dd08856b26850c935b4a81ab2364711335fe01c397083160f530b3382bbc239c6a8135be6a032e93039083ec2cefdae2902429a2e0 kernel.h
+6f309a18c65c991240265afd200cc79a706f5d9e5d072838a9a641ab3676a5e4c32033f9767fc723ff4c45ee462169a0f77bd7dfe63b547d521dadd073f827a7 uapi-iphdr.patch"
diff --git a/system/easy-kernel/uapi-iphdr.patch b/system/easy-kernel/uapi-iphdr.patch
new file mode 100644
index 000000000..8436b035b
--- /dev/null
+++ b/system/easy-kernel/uapi-iphdr.patch
@@ -0,0 +1,47 @@
+From 62689a5371ff8bbfc8c04625794c62d957b0863f Mon Sep 17 00:00:00 2001
+From: "A. Wilcox" <AWilcox@Wilcox-Tech.com>
+Date: Sat, 21 Dec 2019 23:36:33 -0600
+Subject: [PATCH] uapi: Prevent redefinition of struct iphdr
+
+As with struct ethhdr, the musl libc provides its own definition of the
+iphdr struct. This guard ensures software like net-tools builds correctly
+on the musl libc.
+
+The __UAPI_DEF_IPHDR definition is in ip.h itself to prevent the issue in
+commit da360299b673 ("uapi/if_ether.h: move __UAPI_DEF_ETHHDR libc define")
+from being seen here.
+
+Signed-off-by: A. Wilcox <AWilcox@Wilcox-Tech.com>
+---
+ include/uapi/linux/ip.h | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/include/uapi/linux/ip.h b/include/uapi/linux/ip.h
+index e42d13b55cf3..d34a0d295672 100644
+--- a/include/uapi/linux/ip.h
++++ b/include/uapi/linux/ip.h
+@@ -83,6 +83,13 @@
+
+ #define IPV4_BEET_PHMAXLEN 8
+
++/* Allow libcs to deactivate this - musl has its own copy in <netinet/ip.h> */
++
++#ifndef __UAPI_DEF_IPHDR
++#define __UAPI_DEF_IPHDR 1
++#endif
++
++#if __UAPI_DEF_IPHDR
+ struct iphdr {
+ #if defined(__LITTLE_ENDIAN_BITFIELD)
+ __u8 ihl:4,
+@@ -104,6 +111,7 @@ struct iphdr {
+ __be32 daddr;
+ /*The options start here. */
+ };
++#endif
+
+
+ struct ip_auth_hdr {
+--
+2.22.1
+
diff --git a/system/musl/APKBUILD b/system/musl/APKBUILD
index ad2bbaf06..0758f513a 100644
--- a/system/musl/APKBUILD
+++ b/system/musl/APKBUILD
@@ -26,6 +26,7 @@ source="https://distfiles.adelielinux.org/source/$pkgname-$pkgver.tar.xz
3001-make-real-lastlog-h.patch
handle-aux-at_base.patch
fgetspent_r.patch
+ uapi-iphdr.patch
ldconfig
getent.c
@@ -121,6 +122,7 @@ f01ab92b9d385c15369c0bb7d95e1bc06a009c8851e363517d0ba1bae3fc2647af69fc2f363b5d96
88ae443dbb8e0a4368235bdc3a1c5c7b718495afa75e06deb8e01becc76cb1f0d6964589e2204fc749c9c1b3190b8b9ac1ae2c0099cab8e2ce3ec877103d4332 3001-make-real-lastlog-h.patch
6a7ff16d95b5d1be77e0a0fbb245491817db192176496a57b22ab037637d97a185ea0b0d19da687da66c2a2f5578e4343d230f399d49fe377d8f008410974238 handle-aux-at_base.patch
ded41235148930f8cf781538f7d63ecb0c65ea4e8ce792565f3649ee2523592a76b2a166785f0b145fc79f5852fd1fb1729a7a09110b3b8f85cba3912e790807 fgetspent_r.patch
+3b3866a32321cf72b72470230b88cde6bfc9f63e6ec33fef6023286b5733f90feed32b65b82d59ec353deb2ee199c1c95825802d7588019bf016b39d327f3c73 uapi-iphdr.patch
cb71d29a87f334c75ecbc911becde7be825ab30d8f39fa6d64cb53812a7c9abaf91d9804c72540e5be3ddd3c84cfe7fd9632274309005cb8bcdf9a9b09b4b923 ldconfig
378d70e65bcc65bb4e1415354cecfa54b0c1146dfb24474b69e418cdbf7ad730472cd09f6f103e1c99ba6c324c9560bccdf287f5889bbc3ef0bdf0e08da47413 getent.c
9d42d66fb1facce2b85dad919be5be819ee290bd26ca2db00982b2f8e055a0196290a008711cbe2b18ec9eee8d2270e3b3a4692c5a1b807013baa5c2b70a2bbf iconv.c"
diff --git a/system/musl/uapi-iphdr.patch b/system/musl/uapi-iphdr.patch
new file mode 100644
index 000000000..8483ca306
--- /dev/null
+++ b/system/musl/uapi-iphdr.patch
@@ -0,0 +1,30 @@
+From 7e690371dbc52b0f771bc7cdecdb757d5e1a4c11 Mon Sep 17 00:00:00 2001
+From: "A. Wilcox" <AWilcox@Wilcox-Tech.com>
+Date: Sun, 22 Dec 2019 00:04:28 -0600
+Subject: [PATCH] netinet/ip.h: Add UAPI definition guard for iphdr
+
+This ensures that the musl definition of 'struct iphdr' does not conflict
+with the Linux kernel UAPI definition of it.
+
+Some software, i.e. net-tools, will not compile against 5.4 kernel headers
+without this patch and the corresponding Linux kernel patch.
+---
+ include/netinet/ip.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/include/netinet/ip.h b/include/netinet/ip.h
+index 8b6d7fef..0ae132a5 100644
+--- a/include/netinet/ip.h
++++ b/include/netinet/ip.h
+@@ -190,6 +190,8 @@ struct ip_timestamp {
+
+ #define IP_MSS 576
+
++#define __UAPI_DEF_IPHDR 0
++
+ #ifdef __cplusplus
+ }
+ #endif
+--
+2.22.1
+