summaryrefslogtreecommitdiffstats
path: root/patches/iptables-1.8.2/0001-include-fix-build-with-kernel-headers-before-4.2.patch
blob: 34bb99f277fadc5c7071e2576e7ef916d26fc094 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

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>
---
 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>