summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2015-04-10 18:20:41 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-04-13 22:33:23 +0100
commit0b708c5c5799acccc0fdab6c26c2ed6d900b0feb (patch)
tree3cef94abdace704b720b1f7c0f025ecfbed8a718 /meta/recipes-extended
parent65b4ed63ad89dfd24cbf42bc2c360210094da9de (diff)
downloadpoky-0b708c5c5799acccc0fdab6c26c2ed6d900b0feb.tar.gz
iptables: Fix build on musl
Added needed headers and resuffled existing ones to get it portable Added defined for missing TCOPTS* Change-Id: I74977dd052c5569b00631379d7f4bacfb86cf381 (From OE-Core rev: d30fba63286dc8f5ac72ac65fae6af6001e58ec2) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-extended')
-rw-r--r--meta/recipes-extended/iptables/iptables/0001-fix-build-with-musl.patch89
-rw-r--r--meta/recipes-extended/iptables/iptables_1.4.21.bb1
2 files changed, 90 insertions, 0 deletions
diff --git a/meta/recipes-extended/iptables/iptables/0001-fix-build-with-musl.patch b/meta/recipes-extended/iptables/iptables/0001-fix-build-with-musl.patch
new file mode 100644
index 0000000000..7a003d912f
--- /dev/null
+++ b/meta/recipes-extended/iptables/iptables/0001-fix-build-with-musl.patch
@@ -0,0 +1,89 @@
1From 7c07b7fd4fdd7844dd032af822306f08e4422c34 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Mon, 6 Apr 2015 20:47:29 -0700
4Subject: [PATCH] fix build with musl
5
6Add needed headers they are just not needed for glibc6+ but also
7for musl
8Define additional TCOPTS if not there
9
10u_initX types are in sys/types.h be explicit about it
11
12Upstream-Status: Pending
13
14Signed-off-by: Khem Raj <raj.khem@gmail.com>
15---
16 extensions/libxt_TCPOPTSTRIP.c | 15 +++++++++++++++
17 include/libiptc/ipt_kernel_headers.h | 12 ------------
18 include/linux/netfilter_ipv4/ip_tables.h | 1 +
19 3 files changed, 16 insertions(+), 12 deletions(-)
20
21diff --git a/extensions/libxt_TCPOPTSTRIP.c b/extensions/libxt_TCPOPTSTRIP.c
22index 6897857..8a170b2 100644
23--- a/extensions/libxt_TCPOPTSTRIP.c
24+++ b/extensions/libxt_TCPOPTSTRIP.c
25@@ -12,6 +12,21 @@
26 #ifndef TCPOPT_MD5SIG
27 # define TCPOPT_MD5SIG 19
28 #endif
29+#ifndef TCPOPT_MAXSEG
30+# define TCPOPT_MAXSEG 2
31+#endif
32+#ifndef TCPOPT_WINDOW
33+# define TCPOPT_WINDOW 3
34+#endif
35+#ifndef TCPOPT_SACK_PERMITTED
36+# define TCPOPT_SACK_PERMITTED 4
37+#endif
38+#ifndef TCPOPT_SACK
39+# define TCPOPT_SACK 5
40+#endif
41+#ifndef TCPOPT_TIMESTAMP
42+# define TCPOPT_TIMESTAMP 8
43+#endif
44
45 enum {
46 O_STRIP_OPTION = 0,
47diff --git a/include/libiptc/ipt_kernel_headers.h b/include/libiptc/ipt_kernel_headers.h
48index 18861fe..a5963e9 100644
49--- a/include/libiptc/ipt_kernel_headers.h
50+++ b/include/libiptc/ipt_kernel_headers.h
51@@ -5,7 +5,6 @@
52
53 #include <limits.h>
54
55-#if defined(__GLIBC__) && __GLIBC__ == 2
56 #include <netinet/ip.h>
57 #include <netinet/in.h>
58 #include <netinet/ip_icmp.h>
59@@ -13,15 +12,4 @@
60 #include <netinet/udp.h>
61 #include <net/if.h>
62 #include <sys/types.h>
63-#else /* libc5 */
64-#include <sys/socket.h>
65-#include <linux/ip.h>
66-#include <linux/in.h>
67-#include <linux/if.h>
68-#include <linux/icmp.h>
69-#include <linux/tcp.h>
70-#include <linux/udp.h>
71-#include <linux/types.h>
72-#include <linux/in6.h>
73-#endif
74 #endif
75diff --git a/include/linux/netfilter_ipv4/ip_tables.h b/include/linux/netfilter_ipv4/ip_tables.h
76index 57fd82a..4807246 100644
77--- a/include/linux/netfilter_ipv4/ip_tables.h
78+++ b/include/linux/netfilter_ipv4/ip_tables.h
79@@ -15,6 +15,7 @@
80 #ifndef _IPTABLES_H
81 #define _IPTABLES_H
82
83+#include <sys/types.h>
84 #include <linux/types.h>
85
86 #include <linux/netfilter_ipv4.h>
87--
882.1.4
89
diff --git a/meta/recipes-extended/iptables/iptables_1.4.21.bb b/meta/recipes-extended/iptables/iptables_1.4.21.bb
index dc17d575dd..31c017b2ce 100644
--- a/meta/recipes-extended/iptables/iptables_1.4.21.bb
+++ b/meta/recipes-extended/iptables/iptables_1.4.21.bb
@@ -22,6 +22,7 @@ FILES_${PN}-dbg =+ "${libdir}/xtables/.debug"
22SRC_URI = "http://netfilter.org/projects/iptables/files/iptables-${PV}.tar.bz2 \ 22SRC_URI = "http://netfilter.org/projects/iptables/files/iptables-${PV}.tar.bz2 \
23 file://types.h-add-defines-that-are-required-for-if_packet.patch \ 23 file://types.h-add-defines-that-are-required-for-if_packet.patch \
24 file://0001-configure-Add-option-to-enable-disable-libnfnetlink.patch \ 24 file://0001-configure-Add-option-to-enable-disable-libnfnetlink.patch \
25 file://0001-fix-build-with-musl.patch \
25 " 26 "
26 27
27SRC_URI[md5sum] = "536d048c8e8eeebcd9757d0863ebb0c0" 28SRC_URI[md5sum] = "536d048c8e8eeebcd9757d0863ebb0c0"