Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1343877 > unrolled thread

Re: [PATCH] uapi glibc compat: fix cases where glibc net/if.h is included before linux/if.h

Started byMikko Rapeli <mikko.rapeli@iki.fi>
First post2016-02-26 08:30 +0100
Last post2016-02-26 17:30 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH] uapi glibc compat: fix cases where glibc net/if.h is  included before linux/if.h Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-02-26 08:30 +0100
    Re: [PATCH] uapi glibc compat: fix cases where glibc net/if.h is  included before linux/if.h David Miller <davem@davemloft.net> - 2016-02-26 17:30 +0100

#1343877 — Re: [PATCH] uapi glibc compat: fix cases where glibc net/if.h is included before linux/if.h

FromMikko Rapeli <mikko.rapeli@iki.fi>
Date2016-02-26 08:30 +0100
SubjectRe: [PATCH] uapi glibc compat: fix cases where glibc net/if.h is included before linux/if.h
Message-ID<r6l0D-8aG-21@gated-at.bofh.it>
(Adding libc-alpha list, review of https://lkml.org/lkml/2016/2/7/89 )

On Wed, Feb 17, 2016 at 10:46:20AM -0500, David Miller wrote:
> From: Mikko Rapeli <mikko.rapeli@iki.fi>
> Date: Sun,  7 Feb 2016 16:03:21 +0200
> 
> > @@ -68,6 +72,8 @@
> >   * @IFF_ECHO: echo sent packets. Volatile.
> >   */
> >  enum net_device_flags {
> > +/* for compatibility with glibc net/if.h */
> > +#if __UAPI_DEF_IF_NET_DEVICE_FLAGS
> >  	IFF_UP				= 1<<0,  /* sysfs */
> >  	IFF_BROADCAST			= 1<<1,  /* volatile */
> >  	IFF_DEBUG			= 1<<2,  /* sysfs */
> > @@ -84,11 +90,14 @@ enum net_device_flags {
> >  	IFF_PORTSEL			= 1<<13, /* sysfs */
> >  	IFF_AUTOMEDIA			= 1<<14, /* sysfs */
> >  	IFF_DYNAMIC			= 1<<15, /* sysfs */
> > +#endif /* __UAPI_DEF_IF_NET_DEVICE_FLAGS */
> >  	IFF_LOWER_UP			= 1<<16, /* volatile */
> >  	IFF_DORMANT			= 1<<17, /* volatile */
> >  	IFF_ECHO			= 1<<18, /* volatile */
> >  };
> 
> This is going to get messy is IFF_LOWER_UP, IFF_DORMANT, and IFF_ECHO
> get added the the glibc header.  Why not just handle it now with
> another __UAPI_DEF_FOO guard so that the additions to net/if.h can
> deal with this case too.

Do you mean that the enum should be protected with a single guard or
should I have one guard for current conflicts and one for the future
if glibc headers include IFF_LOWER_UP and others?

-Mikko

[toc] | [next] | [standalone]


#1344415

FromDavid Miller <davem@davemloft.net>
Date2016-02-26 17:30 +0100
Message-ID<r6trb-5Z1-9@gated-at.bofh.it>
In reply to#1343877
From: Mikko Rapeli <mikko.rapeli@iki.fi>
Date: Fri, 26 Feb 2016 09:25:13 +0200

> (Adding libc-alpha list, review of https://lkml.org/lkml/2016/2/7/89 )
> 
> On Wed, Feb 17, 2016 at 10:46:20AM -0500, David Miller wrote:
>> From: Mikko Rapeli <mikko.rapeli@iki.fi>
>> Date: Sun,  7 Feb 2016 16:03:21 +0200
>> 
>> > @@ -68,6 +72,8 @@
>> >   * @IFF_ECHO: echo sent packets. Volatile.
>> >   */
>> >  enum net_device_flags {
>> > +/* for compatibility with glibc net/if.h */
>> > +#if __UAPI_DEF_IF_NET_DEVICE_FLAGS
>> >  	IFF_UP				= 1<<0,  /* sysfs */
>> >  	IFF_BROADCAST			= 1<<1,  /* volatile */
>> >  	IFF_DEBUG			= 1<<2,  /* sysfs */
>> > @@ -84,11 +90,14 @@ enum net_device_flags {
>> >  	IFF_PORTSEL			= 1<<13, /* sysfs */
>> >  	IFF_AUTOMEDIA			= 1<<14, /* sysfs */
>> >  	IFF_DYNAMIC			= 1<<15, /* sysfs */
>> > +#endif /* __UAPI_DEF_IF_NET_DEVICE_FLAGS */
>> >  	IFF_LOWER_UP			= 1<<16, /* volatile */
>> >  	IFF_DORMANT			= 1<<17, /* volatile */
>> >  	IFF_ECHO			= 1<<18, /* volatile */
>> >  };
>> 
>> This is going to get messy is IFF_LOWER_UP, IFF_DORMANT, and IFF_ECHO
>> get added the the glibc header.  Why not just handle it now with
>> another __UAPI_DEF_FOO guard so that the additions to net/if.h can
>> deal with this case too.
> 
> Do you mean that the enum should be protected with a single guard or
> should I have one guard for current conflicts and one for the future
> if glibc headers include IFF_LOWER_UP and others?

I'm ambivalent about the mechanism, and I'm more concerned about covering
those three values in your change rather than eliding them.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web