lkml.org 
[lkml]   [2017]   [Aug]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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@obsidianresearch.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@obsidianresearch.com>

\
 
 \ /
  Last update: 2017-08-09 17:54    [W:0.072 / U:5.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site