Add luci mirror repository
[librecmc/librecmc.git] / package / network / utils / iptables / patches / 002-include_fix_build_with_kernel_headers_before_4_2.patch
1 From 8d9d7e4b9ef4c6e6abab2cf35c747d7ca36824bd Mon Sep 17 00:00:00 2001
2 From: Baruch Siach <baruch@tkos.co.il>
3 Date: Fri, 16 Nov 2018 09:30:33 +0200
4 Subject: include: fix build with kernel headers before 4.2
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 Commit 672accf1530 (include: update kernel netfilter header files)
10 updated linux/netfilter.h and brought with it the update from kernel
11 commit a263653ed798 (netfilter: don't pull include/linux/netfilter.h
12 from netns headers). This triggers conflict of headers that is fixed in
13 kernel commit 279c6c7fa64f (api: fix compatibility of linux/in.h with
14 netinet/in.h) included in kernel version 4.2. For earlier kernel headers
15 we need a workaround that prevents the headers conflict.
16
17 Fixes the following build failure:
18
19 In file included from .../sysroot/usr/include/netinet/ip.h:25:0,
20                  from ../include/libiptc/ipt_kernel_headers.h:8,
21                  from ../include/libiptc/libiptc.h:6,
22                  from libip4tc.c:29:
23 .../sysroot/usr/include/linux/in.h:26:3: error: redeclaration of enumerator ‘IPPROTO_IP’
24    IPPROTO_IP = 0,  /* Dummy protocol for TCP  */
25    ^
26 .../sysroot/usr/include/netinet/in.h:33:5: note: previous definition of ‘IPPROTO_IP’ was here
27      IPPROTO_IP = 0,    /* Dummy protocol for TCP.  */
28      ^~~~~~~~~~
29
30 Signed-off-by: Baruch Siach <baruch@tkos.co.il>
31 Signed-off-by: Florian Westphal <fw@strlen.de>
32 ---
33  include/linux/netfilter.h | 2 ++
34  1 file changed, 2 insertions(+)
35
36 --- a/include/linux/netfilter.h
37 +++ b/include/linux/netfilter.h
38 @@ -3,8 +3,10 @@
39  
40  #include <linux/types.h>
41  
42 +#ifndef _NETINET_IN_H
43  #include <linux/in.h>
44  #include <linux/in6.h>
45 +#endif
46  #include <limits.h>
47  
48  /* Responses from hook functions. */