netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* PATCH] Revert "bridge: include in6.h in if_bridge.h for struct in6_addr"
@ 2014-12-10  4:30 Stephen Hemminger
  2014-12-10  4:49 ` David Miller
  0 siblings, 1 reply; 6+ messages in thread
From: Stephen Hemminger @ 2014-12-10  4:30 UTC (permalink / raw)
  To: David Miller, Gregory Fong, Florian Fainelli, Cong Wang; +Cc: netdev

This reverts commit 66f1c44887ba4f47d617f8ae21cf8e04e1892bd7.

iproute2 uses sanitized kernel headers, and this change broke the build.
The problem is that the iproute2 ip/iplink_bridge_slave.c include if_bridge.h
but this causes a redefintion error when Glibc <netlink/in.h> is included.

Since iproute2 is arguably the most important user of network headers,
the uapi header change should be reverted.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>

---
Please update stable as well.

 include/uapi/linux/if_bridge.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/include/uapi/linux/if_bridge.h b/include/uapi/linux/if_bridge.h
index b03ee8f..439fd0d 100644
--- a/include/uapi/linux/if_bridge.h
+++ b/include/uapi/linux/if_bridge.h
@@ -15,7 +15,6 @@
 
 #include <linux/types.h>
 #include <linux/if_ether.h>
-#include <linux/in6.h>
 
 #define SYSFS_BRIDGE_ATTR	"bridge"
 #define SYSFS_BRIDGE_FDB	"brforward"
-- 
2.1.3

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: PATCH] Revert "bridge: include in6.h in if_bridge.h for struct in6_addr"
  2014-12-10  4:30 PATCH] Revert "bridge: include in6.h in if_bridge.h for struct in6_addr" Stephen Hemminger
@ 2014-12-10  4:49 ` David Miller
  2014-12-10  5:41   ` [PATCH v2] if_bridge: fix conflict with glibc Stephen Hemminger
  0 siblings, 1 reply; 6+ messages in thread
From: David Miller @ 2014-12-10  4:49 UTC (permalink / raw)
  To: stephen; +Cc: gregory.0xf0, f.fainelli, xiyou.wangcong, netdev

From: Stephen Hemminger <stephen@networkplumber.org>
Date: Tue, 9 Dec 2014 20:30:07 -0800

> This reverts commit 66f1c44887ba4f47d617f8ae21cf8e04e1892bd7.
> 
> iproute2 uses sanitized kernel headers, and this change broke the build.
> The problem is that the iproute2 ip/iplink_bridge_slave.c include if_bridge.h
> but this causes a redefintion error when Glibc <netlink/in.h> is included.
> 
> Since iproute2 is arguably the most important user of network headers,
> the uapi header change should be reverted.
> 
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>

Stephen, please understand first the reason for this change.

GLIBC and the kernel fight over various definitions of core
networking types.

The only way to resolve this in the long term is this change
in question.

If you can make iproute2 work with both the new and the old
mechanims, please do so instead of reverting this important
change.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v2] if_bridge: fix conflict with glibc
  2014-12-10  4:49 ` David Miller
@ 2014-12-10  5:41   ` Stephen Hemminger
  2014-12-10 18:34     ` David Miller
  0 siblings, 1 reply; 6+ messages in thread
From: Stephen Hemminger @ 2014-12-10  5:41 UTC (permalink / raw)
  To: David Miller; +Cc: gregory.0xf0, f.fainelli, xiyou.wangcong, netdev

Even though kernel and glibc headers have same effective values
Gcc complains about redefinitions. Since this is a header expected
to be used by userspace, use glibc header.

This supersedes change in commit 66f1c44887ba4f47d617f8ae21cf8e04e1892bd7
and fixes build of iproute2 with Glibc-2.19. This follows similar usage
in include/uapi/linux for l2tp.h

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>

--- a/include/uapi/linux/if_bridge.h	2014-12-09 20:25:21.656016605 -0800
+++ b/include/uapi/linux/if_bridge.h	2014-12-09 21:32:01.391034756 -0800
@@ -15,7 +15,9 @@
 
 #include <linux/types.h>
 #include <linux/if_ether.h>
-#include <linux/in6.h>
+#ifndef __KERNEL__
+#include <netinet/in.h>
+#endif
 
 #define SYSFS_BRIDGE_ATTR	"bridge"
 #define SYSFS_BRIDGE_FDB	"brforward"

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] if_bridge: fix conflict with glibc
  2014-12-10  5:41   ` [PATCH v2] if_bridge: fix conflict with glibc Stephen Hemminger
@ 2014-12-10 18:34     ` David Miller
  2014-12-10 23:57       ` Stephen Hemminger
  0 siblings, 1 reply; 6+ messages in thread
From: David Miller @ 2014-12-10 18:34 UTC (permalink / raw)
  To: stephen; +Cc: gregory.0xf0, f.fainelli, xiyou.wangcong, netdev

From: Stephen Hemminger <stephen@networkplumber.org>
Date: Tue, 9 Dec 2014 21:41:22 -0800

> Even though kernel and glibc headers have same effective values
> Gcc complains about redefinitions. Since this is a header expected
> to be used by userspace, use glibc header.
> 
> This supersedes change in commit 66f1c44887ba4f47d617f8ae21cf8e04e1892bd7
> and fixes build of iproute2 with Glibc-2.19. This follows similar usage
> in include/uapi/linux for l2tp.h
> 
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> 
> --- a/include/uapi/linux/if_bridge.h	2014-12-09 20:25:21.656016605 -0800
> +++ b/include/uapi/linux/if_bridge.h	2014-12-09 21:32:01.391034756 -0800
> @@ -15,7 +15,9 @@
>  
>  #include <linux/types.h>
>  #include <linux/if_ether.h>
> -#include <linux/in6.h>
> +#ifndef __KERNEL__
> +#include <netinet/in.h>
> +#endif

No, we really want to incluse the linux/in6.h header, as that's where all
the special GLIBC CPP checks are, such as:

#if __UAPI_DEF_IN6_ADDR_ALT

Please research how we have resolved the conflict between GLIBC and the
kernel's exported headers.  We really need to use linux/in6.h for all of
this to work.

I understand that it is upsetting that iproute2 stopped building for you,
but I'd like to kindly ask that you look more deeply into this and think
more longer term, rather than having a knee jerk reaction and looking for
quick fixes.

Thanks.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] if_bridge: fix conflict with glibc
  2014-12-10 18:34     ` David Miller
@ 2014-12-10 23:57       ` Stephen Hemminger
  2014-12-11  1:44         ` David Miller
  0 siblings, 1 reply; 6+ messages in thread
From: Stephen Hemminger @ 2014-12-10 23:57 UTC (permalink / raw)
  To: David Miller; +Cc: gregory.0xf0, f.fainelli, xiyou.wangcong, netdev

On Wed, 10 Dec 2014 13:34:17 -0500 (EST)
David Miller <davem@davemloft.net> wrote:

> From: Stephen Hemminger <stephen@networkplumber.org>
> Date: Tue, 9 Dec 2014 21:41:22 -0800
> 
> > Even though kernel and glibc headers have same effective values
> > Gcc complains about redefinitions. Since this is a header expected
> > to be used by userspace, use glibc header.
> > 
> > This supersedes change in commit 66f1c44887ba4f47d617f8ae21cf8e04e1892bd7
> > and fixes build of iproute2 with Glibc-2.19. This follows similar usage
> > in include/uapi/linux for l2tp.h
> > 
> > Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> > 
> > --- a/include/uapi/linux/if_bridge.h	2014-12-09 20:25:21.656016605 -0800
> > +++ b/include/uapi/linux/if_bridge.h	2014-12-09 21:32:01.391034756 -0800
> > @@ -15,7 +15,9 @@
> >  
> >  #include <linux/types.h>
> >  #include <linux/if_ether.h>
> > -#include <linux/in6.h>
> > +#ifndef __KERNEL__
> > +#include <netinet/in.h>
> > +#endif
> 
> No, we really want to incluse the linux/in6.h header, as that's where all
> the special GLIBC CPP checks are, such as:
> 
> #if __UAPI_DEF_IN6_ADDR_ALT
> 
> Please research how we have resolved the conflict between GLIBC and the
> kernel's exported headers.  We really need to use linux/in6.h for all of
> this to work.
> 
> I understand that it is upsetting that iproute2 stopped building for you,
> but I'd like to kindly ask that you look more deeply into this and think
> more longer term, rather than having a knee jerk reaction and looking for
> quick fixes.

I don't have the time to understand the intricacies of glibc headers.
The problem is that Gcc warns about duplicate definitions in headers;
this is a useful warning and not something that I want to disable.
Hacks with #undef seem to be heading the wrong way.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] if_bridge: fix conflict with glibc
  2014-12-10 23:57       ` Stephen Hemminger
@ 2014-12-11  1:44         ` David Miller
  0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2014-12-11  1:44 UTC (permalink / raw)
  To: stephen; +Cc: gregory.0xf0, f.fainelli, xiyou.wangcong, netdev

From: Stephen Hemminger <stephen@networkplumber.org>
Date: Wed, 10 Dec 2014 15:57:45 -0800

> On Wed, 10 Dec 2014 13:34:17 -0500 (EST)
> David Miller <davem@davemloft.net> wrote:
> 
>> No, we really want to incluse the linux/in6.h header, as that's where all
>> the special GLIBC CPP checks are, such as:
>> 
>> #if __UAPI_DEF_IN6_ADDR_ALT
>> 
>> Please research how we have resolved the conflict between GLIBC and the
>> kernel's exported headers.  We really need to use linux/in6.h for all of
>> this to work.
>> 
>> I understand that it is upsetting that iproute2 stopped building for you,
>> but I'd like to kindly ask that you look more deeply into this and think
>> more longer term, rather than having a knee jerk reaction and looking for
>> quick fixes.
> 
> I don't have the time to understand the intricacies of glibc headers.
> The problem is that Gcc warns about duplicate definitions in headers;
> this is a useful warning and not something that I want to disable.
> Hacks with #undef seem to be heading the wrong way.

GLIBC and the kernel have unconditionally defined various types in
their copies of in.h, and the only way to resolve this moving forward
is to have some communication between the two so we can know who is
in fact in charge of instantianting the type.

The new defines, such as __UAPI_DEF_IN6_ADDR_ALT, are that new
mechanism.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-12-11  1:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-10  4:30 PATCH] Revert "bridge: include in6.h in if_bridge.h for struct in6_addr" Stephen Hemminger
2014-12-10  4:49 ` David Miller
2014-12-10  5:41   ` [PATCH v2] if_bridge: fix conflict with glibc Stephen Hemminger
2014-12-10 18:34     ` David Miller
2014-12-10 23:57       ` Stephen Hemminger
2014-12-11  1:44         ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).