1 |
commit: 56a695955754b0947cc12f99da838eab57f939de |
2 |
Author: Sam James <sam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat May 28 02:52:03 2022 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat May 28 02:52:21 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=56a69595 |
7 |
|
8 |
net-firewall/iptables: fix musl build |
9 |
|
10 |
Closes: https://bugs.gentoo.org/846377 |
11 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
12 |
|
13 |
.../files/iptables-1.8.8-musl-headers.patch | 59 ++++++++++++++++++++++ |
14 |
.../files/iptables-1.8.8-out-of-tree-build.patch | 26 ++++++++++ |
15 |
net-firewall/iptables/iptables-1.8.8-r2.ebuild | 2 + |
16 |
3 files changed, 87 insertions(+) |
17 |
|
18 |
diff --git a/net-firewall/iptables/files/iptables-1.8.8-musl-headers.patch b/net-firewall/iptables/files/iptables-1.8.8-musl-headers.patch |
19 |
new file mode 100644 |
20 |
index 000000000000..52e2c7019972 |
21 |
--- /dev/null |
22 |
+++ b/net-firewall/iptables/files/iptables-1.8.8-musl-headers.patch |
23 |
@@ -0,0 +1,59 @@ |
24 |
+https://git.netfilter.org/iptables/commit/?id=0e7cf0ad306cdf95dc3c28d15a254532206a888e |
25 |
+https://bugs.gentoo.org/846377 |
26 |
+ |
27 |
+From: Phil Sutter <phil@×××.cc> |
28 |
+Date: Wed, 18 May 2022 16:04:09 +0200 |
29 |
+Subject: Revert "fix build for missing ETH_ALEN definition" |
30 |
+MIME-Version: 1.0 |
31 |
+Content-Type: text/plain; charset=UTF-8 |
32 |
+Content-Transfer-Encoding: 8bit |
33 |
+ |
34 |
+This reverts commit c5d9a723b5159a28f547b577711787295a14fd84 as it broke |
35 |
+compiling against musl libc. Might be a bug in the latter, but for the |
36 |
+time being try to please both by avoiding the include and instead |
37 |
+defining ETH_ALEN if unset. |
38 |
+ |
39 |
+While being at it, move netinet/ether.h include up. |
40 |
+ |
41 |
+Fixes: 1bdb5535f561a ("libxtables: Extend MAC address printing/parsing support") |
42 |
+Signed-off-by: Phil Sutter <phil@×××.cc> |
43 |
+Reviewed-by: Maciej Żenczykowski <maze@××××××.com> |
44 |
+--- a/libxtables/xtables.c |
45 |
++++ b/libxtables/xtables.c |
46 |
+@@ -28,6 +28,7 @@ |
47 |
+ #include <stdlib.h> |
48 |
+ #include <string.h> |
49 |
+ #include <unistd.h> |
50 |
++#include <netinet/ether.h> |
51 |
+ #include <sys/socket.h> |
52 |
+ #include <sys/stat.h> |
53 |
+ #include <sys/statfs.h> |
54 |
+@@ -45,7 +46,6 @@ |
55 |
+ |
56 |
+ #include <xtables.h> |
57 |
+ #include <limits.h> /* INT_MAX in ip_tables.h/ip6_tables.h */ |
58 |
+-#include <linux/if_ether.h> /* ETH_ALEN */ |
59 |
+ #include <linux/netfilter_ipv4/ip_tables.h> |
60 |
+ #include <linux/netfilter_ipv6/ip6_tables.h> |
61 |
+ #include <libiptc/libxtc.h> |
62 |
+@@ -72,6 +72,10 @@ |
63 |
+ #define PROC_SYS_MODPROBE "/proc/sys/kernel/modprobe" |
64 |
+ #endif |
65 |
+ |
66 |
++#ifndef ETH_ALEN |
67 |
++#define ETH_ALEN 6 |
68 |
++#endif |
69 |
++ |
70 |
+ /* we need this for ip6?tables-restore. ip6?tables-restore.c sets line to the |
71 |
+ * current line of the input file, in order to give a more precise error |
72 |
+ * message. ip6?tables itself doesn't need this, so it is initialized to the |
73 |
+@@ -2245,8 +2249,6 @@ void xtables_print_num(uint64_t number, unsigned int format) |
74 |
+ printf(FMT("%4lluT ","%lluT "), (unsigned long long)number); |
75 |
+ } |
76 |
+ |
77 |
+-#include <netinet/ether.h> |
78 |
+- |
79 |
+ static const unsigned char mac_type_unicast[ETH_ALEN] = {}; |
80 |
+ static const unsigned char msk_type_unicast[ETH_ALEN] = {1}; |
81 |
+ static const unsigned char mac_type_multicast[ETH_ALEN] = {1}; |
82 |
+cgit v1.2.3 |
83 |
|
84 |
diff --git a/net-firewall/iptables/files/iptables-1.8.8-out-of-tree-build.patch b/net-firewall/iptables/files/iptables-1.8.8-out-of-tree-build.patch |
85 |
new file mode 100644 |
86 |
index 000000000000..ee9e218b5dbd |
87 |
--- /dev/null |
88 |
+++ b/net-firewall/iptables/files/iptables-1.8.8-out-of-tree-build.patch |
89 |
@@ -0,0 +1,26 @@ |
90 |
+https://git.netfilter.org/iptables/commit/?id=0ebf52fc951b2a4d98a166afb34af4f364bbeece |
91 |
+ |
92 |
+From: Ben Brown <ben@××××××××.io> |
93 |
+Date: Wed, 25 May 2022 16:26:13 +0100 |
94 |
+Subject: build: Fix error during out of tree build |
95 |
+ |
96 |
+Fixes the following error: |
97 |
+ |
98 |
+ ../../libxtables/xtables.c:52:10: fatal error: libiptc/linux_list.h: No such file or directory |
99 |
+ 52 | #include <libiptc/linux_list.h> |
100 |
+ |
101 |
+Fixes: f58b0d7406451 ("libxtables: Implement notargets hash table") |
102 |
+Signed-off-by: Ben Brown <ben@××××××××.io> |
103 |
+Signed-off-by: Phil Sutter <phil@×××.cc> |
104 |
+--- a/libxtables/Makefile.am |
105 |
++++ b/libxtables/Makefile.am |
106 |
+@@ -1,7 +1,7 @@ |
107 |
+ # -*- Makefile -*- |
108 |
+ |
109 |
+ AM_CFLAGS = ${regular_CFLAGS} |
110 |
+-AM_CPPFLAGS = ${regular_CPPFLAGS} -I${top_builddir}/include -I${top_srcdir}/include -I${top_srcdir}/iptables ${kinclude_CPPFLAGS} |
111 |
++AM_CPPFLAGS = ${regular_CPPFLAGS} -I${top_builddir}/include -I${top_srcdir}/include -I${top_srcdir}/iptables -I${top_srcdir} ${kinclude_CPPFLAGS} |
112 |
+ |
113 |
+ lib_LTLIBRARIES = libxtables.la |
114 |
+ libxtables_la_SOURCES = xtables.c xtoptions.c getethertype.c |
115 |
+cgit v1.2.3 |
116 |
|
117 |
diff --git a/net-firewall/iptables/iptables-1.8.8-r2.ebuild b/net-firewall/iptables/iptables-1.8.8-r2.ebuild |
118 |
index 03c908c9d9b1..c4fcdc0fb260 100644 |
119 |
--- a/net-firewall/iptables/iptables-1.8.8-r2.ebuild |
120 |
+++ b/net-firewall/iptables/iptables-1.8.8-r2.ebuild |
121 |
@@ -52,6 +52,8 @@ PATCHES=( |
122 |
|
123 |
"${FILESDIR}/${P}-format-security.patch" |
124 |
"${FILESDIR}/${P}-uint-musl.patch" |
125 |
+ "${FILESDIR}/${P}-musl-headers.patch" |
126 |
+ "${FILESDIR}/${P}-out-of-tree-build.patch" |
127 |
) |
128 |
|
129 |
src_prepare() { |