iptunnel: drop netinet/ip.h include 85/287985/1
authorMike Frysinger <vapier@gentoo.org>
Thu, 10 Nov 2016 23:59:19 +0000 (18:59 -0500)
committerMarek Pikuła <m.pikula@partner.samsung.com>
Wed, 8 Feb 2023 13:45:12 +0000 (14:45 +0100)
commit629e2c6e2ec0aa33ce1be277cb32751fddea8e53
treec3cee0ad1707783db1f5d0412f96df69f0f3da7f
parentc96fafe66ee186d3d701d50a74cde1ee9e6d6093
iptunnel: drop netinet/ip.h include

The only reason we include this header is to get the IP_DF define.
However, we already have a local #define fallback in case that isn't
already defined for us.

Including this header while also including linux/if_tunnel.h causes
problems with newer Linux headers (v4.8+):
cc -O2 -g -Wall -fno-strict-aliasing  -D_GNU_SOURCE \
-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE \
-I. -I/usr/local/src/net-tools/include -Ilib -c iptunnel.c
In file included from /usr/include/linux/if_tunnel.h:6:0,
                 from iptunnel.c:34:
/usr/include/linux/ip.h:85:8: error: redefinition of 'struct iphdr'
 struct iphdr {
        ^
In file included from iptunnel.c:29:0:
/usr/include/netinet/ip.h:44:8: note: originally defined here
 struct iphdr
        ^

Changing netinet/ip.h to linux/ip.h won't help because it doesn't
provide IP_DF or anything else we care about.  Simply drop the header
to avoid the build failure.

Change-Id: Ie8673fbeedd767c6f483008608b7a07e7e04a376
Reported-by: Randy MacLeod <randy.macleod@windriver.com>
Source: https://sourceforge.net/p/net-tools/code/ci/45d573a89386c934d3ebac499d00c1670437813b/
iptunnel.c