lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <06d85c1ec9537fba479f9d02e938feeb7f623662.camel@alliedtelesis.co.nz>
Date:   Mon, 10 Feb 2020 22:37:30 +0000
From:   Chris Packham <Chris.Packham@...iedtelesis.co.nz>
To:     "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "libc-help@...rceware.org" <libc-help@...rceware.org>
Subject: redefinition of 'struct iphdr' - netinet/ip.h vs linux/ip.h

Hi,

I have an application that wants to include both netinet/ip.h and
linux/if_tunnel.h.

As of kernel headers versions newer than v4.8 the application fails to
compile with the following error

  make[1]: Entering directory 'compile-test'
    CC       compile-test.o
  In file included from /usr/include/linux/if_tunnel.h:7,
                   from compile-test.c:3:
  /usr/include/linux/ip.h:86:8: error: redefinition of 'struct iphdr'
   struct iphdr {
        ^~~~~
  In file included from compile-test.c:2:
  /usr/include/netinet/ip.h:44:8: note: originally defined here
   struct iphdr
          ^~~~~
  make[1]: *** [Makefile:385: compile-test.o] Error 1

Looking at the linux commit commit 1fe8e0f074c7
("include/uapi/linux/if_tunnel.h: include linux/if.h, linux/ip.h and
linux/in6.h") I can see that the application was probably working by
luck.

Doing a bit of searching I can see various fixes with removing one of
the offending header files but this causes more problems for the
application in question.

Is there a way of making netinet/ip.h and linux/if_tunnel.h co-exist?

Thanks,
Chris Packham

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ