netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Ben Greear <greearb@candelatech.com>
Cc: netdev <netdev@vger.kernel.org>, mikko.rapeli@iki.fi
Subject: Re: Commit 1fe8e0... (include more headers in if_tunnel.h) breaks my user-space build.
Date: Fri, 13 Jan 2017 14:08:06 -0800	[thread overview]
Message-ID: <20170113140806.01f65b8a@xeon-e3> (raw)
In-Reply-To: <6c983e7e-dbb3-3542-ffed-95f4d2f3c5bc@candelatech.com>

On Fri, 13 Jan 2017 11:50:32 -0800
Ben Greear <greearb@candelatech.com> wrote:

> On 01/13/2017 11:41 AM, Stephen Hemminger wrote:
> > On Fri, 13 Jan 2017 11:12:32 -0800
> > Ben Greear <greearb@candelatech.com> wrote:
> >  
> >> I am including netinet/ip.h, and also linux/if_tunnel.h, and the linux/ip.h conflicts with
> >> netinet/ip.h.
> >>
> >> Maybe my build environment is screwed up, but maybe also it would be better to
> >> just let the user include appropriate headers before including if_tunnel.h
> >> and revert this patch?
> >>
> >>
> >> include/uapi/linux/if_tunnel.h: include linux/if.h, linux/ip.h and linux/in6.h
> >>
> >>      Fixes userspace compilation errors like:
> >>
> >>      error: field ‘iph’ has incomplete type
> >>      error: field ‘prefix’ has incomplete type
> >>
> >>      Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
> >>      Signed-off-by: David S. Miller <davem@davemloft.net>
> >>
> >> Thanks,
> >> Ben
> >>  
> >
> > What I ended up doing for iproute2 was including all headers used by the source
> > based on sanitized kernel headers.  Basically
> >   $ git grep '^#include <linux/' | \
> > 	awk -F: '{print $2}' | \
> > 	sed -e 's/^#include <//' -e 's/>.*$//' | \
> > 	sort -u >linux.headers
> >    $ for f in $(cat linux.headers)
> >      do cp ~/kernel/net-next/usr/include/$f include/$f
> >      done
> >
> > You can't take only some of the headers, once you decide to diverge from glibc provided
> > headers, you got to take them all.
> >  
> 
> I do grab a copy of the linux kernel headers and compile against that, but netinet/ip.h is
> coming from the OS.  Do you mean I should not include netinet/ip.h and instead use linux/ip.h?

I don't think you can mix netinet/ip.h and linux/ip.h, yes that is a mess.

  reply	other threads:[~2017-01-13 22:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-13 19:12 Commit 1fe8e0... (include more headers in if_tunnel.h) breaks my user-space build Ben Greear
2017-01-13 19:21 ` Ben Greear
2017-01-13 19:41 ` Stephen Hemminger
2017-01-13 19:50   ` Ben Greear
2017-01-13 22:08     ` Stephen Hemminger [this message]
2017-01-13 22:11       ` Ben Greear
2017-01-14  6:43         ` Mikko Rapeli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170113140806.01f65b8a@xeon-e3 \
    --to=stephen@networkplumber.org \
    --cc=greearb@candelatech.com \
    --cc=mikko.rapeli@iki.fi \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).