[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170809155241.GB15586@obsidianresearch.com>
Date: Wed, 9 Aug 2017 09:52:41 -0600
From: Jason Gunthorpe <jgunthorpe@...idianresearch.com>
To: Moni Shoua <monis@...lanox.com>
Cc: Mikko Rapeli <mikko.rapeli@....fi>,
Linux Kernel Mailinglist <linux-kernel@...r.kernel.org>,
linux-api@...r.kernel.org, Sean Hefty <sean.hefty@...el.com>,
Hal Rosenstock <hal.rosenstock@...il.com>,
linux-rdma <linux-rdma@...r.kernel.org>,
Doug Ledford <dledford@...hat.com>
Subject: Re: [PATCH v06 30/36] uapi rdma/rdma_user_rxe.h: include in.h and
in6.h
On Wed, Aug 09, 2017 at 04:48:08PM +0300, Moni Shoua wrote:
> >
> > I'm not sure this is a good idea, linux/in.h should not be included in
> > userspace users of this file, 'sockaddr_in' needs to come from glibc's
> > 'netinet/in.h' instead..
> Is it wrong to include include/uapi/linux/in.h from userspace?
Generally speaking userspace should always use the glibc version of
the headers and not headers from under linux/
Even if it is OK to include both today, that may not be true as glibc
or the kernel changes, and we end up with broken builds.
For instance look at this commit for a real problem caused by mixing
net/if.h and linux/if.h:
commit dc386fcf4a6d5dc0cc0052437c1cb161b7781592
Author: Jason Gunthorpe <jgunthorpe@...idianresearch.com>
Date: Fri Oct 14 12:04:42 2016 -0600
verbs: Use cmake to detect if net/if.h vs netling/route/link.h is broken
If not then just use the header directly, otherwise use the work around.
The issue is that old libnl libraries include linux/if.h and the
declarations there conflict with net/if.h. New libraries do not
do this.
Signed-off-by: Jason Gunthorpe <jgunthorpe@...idianresearch.com>
Powered by blists - more mailing lists