]> git.ipfire.org Git - thirdparty/iptables.git/commit
include: fix build with kernel headers before 4.2
authorBaruch Siach <baruch@tkos.co.il>
Fri, 16 Nov 2018 07:30:33 +0000 (09:30 +0200)
committerFlorian Westphal <fw@strlen.de>
Sat, 17 Nov 2018 20:23:08 +0000 (21:23 +0100)
commit8d9d7e4b9ef4c6e6abab2cf35c747d7ca36824bd
treebfd5c554af9e265dae948a5f753e45508c43b5ea
parentc58ecf9f8bcb7619a27ef8ffaddf847a562475a5
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>
include/linux/netfilter.h