summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorIsmael Luceno2019-05-27 19:42:03 +0200
committerIsmael Luceno2019-05-27 19:42:03 +0200
commit8363663f1e404060a2164604da8521020c3ab754 (patch)
tree1cde8adb5e5b7f47cb328feb8e0771151742a240 /net
parent316d8d4556572447ad2096384d6391d64072a9d6 (diff)
iptables: Move patch out of PRE_BUILD
Diffstat (limited to 'net')
-rw-r--r--net/iptables/HISTORY4
-rwxr-xr-xnet/iptables/PRE_BUILD18
-rw-r--r--net/iptables/patches/0003-include-fix-build-with-kernel-headers-before-4.2.patch50
3 files changed, 55 insertions, 17 deletions
diff --git a/net/iptables/HISTORY b/net/iptables/HISTORY
index 31062dcc95..4cbd1dcbd0 100644
--- a/net/iptables/HISTORY
+++ b/net/iptables/HISTORY
@@ -1,3 +1,7 @@
+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.
+
2019-01-01 Thomas Orgis <sobukus@sourcemage.org>
* PRE_BUILD: added, fix build with older kernel headers (<4.2)
diff --git a/net/iptables/PRE_BUILD b/net/iptables/PRE_BUILD
index cf75715a38..c230ad14bf 100755
--- a/net/iptables/PRE_BUILD
+++ b/net/iptables/PRE_BUILD
@@ -1,19 +1,3 @@
default_pre_build &&
cd "$SOURCE_DIRECTORY" &&
-# Avoid conflict with kernel headers before 4.2 .
-# See http://patchwork.ozlabs.org/patch/998781/ .
-patch -p1 << EOT
-diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h
-index c3f087ac680c..bacf8cd92116 100644
---- a/include/linux/netfilter.h
-+++ b/include/linux/netfilter.h
-@@ -3,7 +3,9 @@
-
- #include <linux/types.h>
-
-+#ifndef _NETINET_IN_H
- #include <linux/in.h>
-+#endif
- #include <linux/in6.h>
- #include <limits.h>
-EOT
+apply_patch_dir patches
diff --git a/net/iptables/patches/0003-include-fix-build-with-kernel-headers-before-4.2.patch b/net/iptables/patches/0003-include-fix-build-with-kernel-headers-before-4.2.patch
new file mode 100644
index 0000000000..6efe9c8bd2
--- /dev/null
+++ b/net/iptables/patches/0003-include-fix-build-with-kernel-headers-before-4.2.patch
@@ -0,0 +1,50 @@
+From 8d9d7e4b9ef4c6e6abab2cf35c747d7ca36824bd Mon Sep 17 00:00:00 2001
+From: Baruch Siach <baruch@tkos.co.il>
+Date: Fri, 16 Nov 2018 09:30:33 +0200
+Subject: [PATCH] include: fix build with kernel headers before 4.2
+
+Commit 672accf1530 (include: update kernel netfilter header files)
+updated linux/netfilter.h and brought with it the update from kernel
+commit a263653ed798 (netfilter: don't pull include/linux/netfilter.h
+from netns headers). This triggers conflict of headers that is fixed in
+kernel commit 279c6c7fa64f (api: fix compatibility of linux/in.h with
+netinet/in.h) included in kernel version 4.2. For earlier kernel headers
+we need a workaround that prevents the headers conflict.
+
+Fixes the following build failure:
+
+In file included from .../sysroot/usr/include/netinet/ip.h:25:0,
+ from ../include/libiptc/ipt_kernel_headers.h:8,
+ from ../include/libiptc/libiptc.h:6,
+ from libip4tc.c:29:
+.../sysroot/usr/include/linux/in.h:26:3: error: redeclaration of enumerator ‘IPPROTO_IP’
+ IPPROTO_IP = 0, /* Dummy protocol for TCP */
+ ^
+.../sysroot/usr/include/netinet/in.h:33:5: note: previous definition of ‘IPPROTO_IP’ was here
+ IPPROTO_IP = 0, /* Dummy protocol for TCP. */
+ ^~~~~~~~~~
+
+Signed-off-by: Baruch Siach <baruch@tkos.co.il>
+Signed-off-by: Florian Westphal <fw@strlen.de>
+---
+Upstream status: commit 8d9d7e4b9ef4c6
+
+ include/linux/netfilter.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h
+index c3f087ac680c..bacf8cd92116 100644
+--- a/include/linux/netfilter.h
++++ b/include/linux/netfilter.h
+@@ -3,7 +3,9 @@
+
+ #include <linux/types.h>
+
++#ifndef _NETINET_IN_H
+ #include <linux/in.h>
++#endif
+ #include <linux/in6.h>
+ #include <limits.h>
+
+--
+2.19.1