public inbox for libc-help@sourceware.org
 help / color / mirror / Atom feed
* redefinition of 'struct iphdr' - netinet/ip.h vs linux/ip.h
@ 2020-02-10 22:37 Chris Packham
  0 siblings, 0 replies; only message in thread
From: Chris Packham @ 2020-02-10 22:37 UTC (permalink / raw)
  To: netdev, libc-help

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-02-10 22:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-10 22:37 redefinition of 'struct iphdr' - netinet/ip.h vs linux/ip.h Chris Packham

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).