[lkml]   [2017]   [Aug]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
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 <>
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 <>

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