tag 824442 - pending clone 824442 -1 reassign -1 linux retitle -1 linux: libc-compat.h sets __UAPI_DEF_IF_* to 1 even when if.h hasn't been included thanks
> On 2017-03-04 17:23, Niels Thykier wrote: > > On Tue, 14 Feb 2017 20:36:43 +0100 Aurelien Jarno <aurel...@aurel32.net> > > wrote: > > > [...] > > > > > > Now that the change have been done on the kernel side, the bug is not > > > really visible anymore, so nobody really cared about this bug. > > > > > > I'll see if I can come with a patch in the next days. > > > > > > Aurelien > > > > > > -- > > > Aurelien Jarno GPG: 4096R/1DDD8C9B > > > aurel...@aurel32.net http://www.aurel32.net > > > > > > > > > > Thanks for the reply. I am looking forward to the patch. :) > > I have opened a bug upstream and sent a patch to the libc-alpha mailing > list. I'll include the patch in the next upload, either today or > tomorrow. Unfortunately I have been pointed on the libc-alpha mailing list that it doesn't work if another file which includes <linux/libc-compat.h> (e.g. <linux/xattr.h>) is included before <net/if.h>. The problem is that the __UAPI_DEF_IF_* constants are set to 1 in <linux/libc-compat.h> even if <linux/if.h> is not included. Even if we are able to workaround that on the glibc side (for example by checking for _LINUX_IF_H), the following sequence doesn't work: #include <linux/xattr.h> #include <net/if.h> #include <linux/if.h> In that case <linux/if.h> tries to redefine the same enum and struct already defined by <net/if.h>, which is obviously a kernel header bug. I am therefore cloning this bug to the kernel headers. A fix is needed on both sides. -- Aurelien Jarno GPG: 4096R/1DDD8C9B aurel...@aurel32.net http://www.aurel32.net