summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorIsmael Luceno2019-05-27 19:43:42 +0200
committerIsmael Luceno2019-05-27 19:43:42 +0200
commit1abfa8e992febccc661f7ab7acdef8b41c28f0a6 (patch)
treeb0c62a515de2346da4d43998556c3a15cfb306c5 /net
parent8363663f1e404060a2164604da8521020c3ab754 (diff)
iptables: Fix build against musl
Diffstat (limited to 'net')
-rw-r--r--net/iptables/HISTORY3
-rw-r--r--net/iptables/patches/0001-ebtables-vlan-fix-userspace-kernel-headers-collision.patch44
-rw-r--r--net/iptables/patches/0004-xtables-monitor-fix-build-with-musl-libc.patch43
3 files changed, 90 insertions, 0 deletions
diff --git a/net/iptables/HISTORY b/net/iptables/HISTORY
index 4cbd1dcbd0..a83801c5f9 100644
--- a/net/iptables/HISTORY
+++ b/net/iptables/HISTORY
@@ -1,6 +1,9 @@
2019-05-27 Ismael Luceno <ismael@sourcemage.org>
* patches/0003-include-fix-build-with-kernel-headers-before-4.2.patch,
PRE_BUILD: Move patch out of PRE_BUILD into a file.
+ * patches/0001-ebtables-vlan-fix-userspace-kernel-headers-collision.patch,
+ patches/0004-xtables-monitor-fix-build-with-musl-libc.patch:
+ Fixed build against musl
2019-01-01 Thomas Orgis <sobukus@sourcemage.org>
* PRE_BUILD: added, fix build with older kernel headers (<4.2)
diff --git a/net/iptables/patches/0001-ebtables-vlan-fix-userspace-kernel-headers-collision.patch b/net/iptables/patches/0001-ebtables-vlan-fix-userspace-kernel-headers-collision.patch
new file mode 100644
index 0000000000..a19d50caf8
--- /dev/null
+++ b/net/iptables/patches/0001-ebtables-vlan-fix-userspace-kernel-headers-collision.patch
@@ -0,0 +1,44 @@
+From 51d374ba41ae4f1bb851228c06b030b83dd2092f Mon Sep 17 00:00:00 2001
+From: Baruch Siach <baruch@tkos.co.il>
+Date: Tue, 13 Nov 2018 19:22:08 +0200
+Subject: [PATCH] ebtables: vlan: fix userspace/kernel headers collision
+
+Build with musl libc fails because of conflicting struct ethhdr
+definitions:
+
+In file included from .../sysroot/usr/include/net/ethernet.h:10:0,
+ from ../iptables/nft-bridge.h:8,
+ from libebt_vlan.c:18:
+.../sysroot/usr/include/netinet/if_ether.h:107:8: error: redefinition of ‘struct ethhdr’
+ struct ethhdr {
+ ^~~~~~
+In file included from libebt_vlan.c:16:0:
+.../sysroot/usr/include/linux/if_ether.h:160:8: note: originally defined here
+ struct ethhdr {
+ ^~~~~~
+
+Include the userspace header first for the definition suppression logic
+to do the right thing.
+
+Signed-off-by: Baruch Siach <baruch@tkos.co.il>
+Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
+---
+Upstream status: commit 51d374ba41ae
+
+ extensions/libebt_vlan.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/extensions/libebt_vlan.c b/extensions/libebt_vlan.c
+index 4a2eb7126895..be269c6cdb4c 100644
+--- a/extensions/libebt_vlan.c
++++ b/extensions/libebt_vlan.c
+@@ -12,6 +12,7 @@
+ #include <getopt.h>
+ #include <ctype.h>
+ #include <xtables.h>
++#include <netinet/if_ether.h>
+ #include <linux/netfilter_bridge/ebt_vlan.h>
+ #include <linux/if_ether.h>
+ #include "iptables/nft.h"
+--
+2.19.1
diff --git a/net/iptables/patches/0004-xtables-monitor-fix-build-with-musl-libc.patch b/net/iptables/patches/0004-xtables-monitor-fix-build-with-musl-libc.patch
new file mode 100644
index 0000000000..6423989256
--- /dev/null
+++ b/net/iptables/patches/0004-xtables-monitor-fix-build-with-musl-libc.patch
@@ -0,0 +1,43 @@
+From 90b0d3abfc0b4150b198eb17080d75acc5838a59 Mon Sep 17 00:00:00 2001
+From: Baruch Siach <baruch@tkos.co.il>
+Date: Sat, 17 Nov 2018 22:20:08 +0200
+Subject: [PATCH] xtables-monitor: fix build with musl libc
+
+Commit 7c8791edac3 ("xtables-monitor: fix build with older glibc")
+changed the code to use GNU style tcphdr fields. Unfortunately, musl
+libc requires _GNU_SOURCE definition to expose these fields.
+
+Fix the following build failure:
+
+xtables-monitor.c: In function ‘trace_print_packet’:
+xtables-monitor.c:406:43: error: ‘const struct tcphdr’ has no member named ‘source’
+ printf("SPORT=%d DPORT=%d ", ntohs(tcph->source), ntohs(tcph->dest));
+ ^~
+xtables-monitor.c:406:64: error: ‘const struct tcphdr’ has no member named ‘dest’
+ printf("SPORT=%d DPORT=%d ", ntohs(tcph->source), ntohs(tcph->dest));
+ ^~
+...
+
+Cc: Florian Westphal <fw@strlen.de>
+Signed-off-by: Baruch Siach <baruch@tkos.co.il>
+Signed-off-by: Florian Westphal <fw@strlen.de>
+---
+Upstream status: commit 90b0d3abfc0b
+
+ iptables/xtables-monitor.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/iptables/xtables-monitor.c b/iptables/xtables-monitor.c
+index 5d1611122df5..f835c5e503e0 100644
+--- a/iptables/xtables-monitor.c
++++ b/iptables/xtables-monitor.c
+@@ -9,6 +9,7 @@
+ * This software has been sponsored by Sophos Astaro <http://www.sophos.com>
+ */
+
++#define _GNU_SOURCE
+ #include <stdlib.h>
+ #include <time.h>
+ #include <string.h>
+--
+2.19.1