All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] ip: include libc headers first
@ 2017-05-22 13:27 Baruch Siach
  2017-05-22 13:27 ` [PATCH 2/2] Add missing <sys/types.h> include Baruch Siach
  2017-05-31  0:31 ` [PATCH 1/2] ip: include libc headers first Stephen Hemminger
  0 siblings, 2 replies; 7+ messages in thread
From: Baruch Siach @ 2017-05-22 13:27 UTC (permalink / raw)
  To: netdev; +Cc: Stephen Hemminger, Baruch Siach

Including libc headers first helps as a workaround to redefinition of struct
ethhdr with a suitably patched musl libc that suppresses the kernel
if_ether.h.

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
---
 ip/iplink_bridge.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ip/iplink_bridge.c b/ip/iplink_bridge.c
index 818b43c89b5b..cccdec1c203a 100644
--- a/ip/iplink_bridge.c
+++ b/ip/iplink_bridge.c
@@ -13,9 +13,9 @@
 #include <stdlib.h>
 #include <string.h>
 #include <netinet/in.h>
+#include <netinet/ether.h>
 #include <linux/if_link.h>
 #include <linux/if_bridge.h>
-#include <netinet/ether.h>
 #include <net/if.h>
 
 #include "rt_names.h"
-- 
2.11.0

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

* [PATCH 2/2] Add missing <sys/types.h> include
  2017-05-22 13:27 [PATCH 1/2] ip: include libc headers first Baruch Siach
@ 2017-05-22 13:27 ` Baruch Siach
  2017-05-22 17:24   ` Stephen Hemminger
  2017-05-31  0:31 ` [PATCH 1/2] ip: include libc headers first Stephen Hemminger
  1 sibling, 1 reply; 7+ messages in thread
From: Baruch Siach @ 2017-05-22 13:27 UTC (permalink / raw)
  To: netdev; +Cc: Stephen Hemminger, Thomas Petazzoni, Baruch Siach

From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

The u_intXX_t types are defined in <sys/types.h>, so it should be
included before using those types. Otherwise, with certain C
libraries, the build fails with:

In file included from ../include/iptables.h:4:0,
                 from m_ipt.c:18:
../include/iptables_common.h:47:16: error: unknown type name ‘u_int32_t’
 #define __le32 u_int32_t

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
---
 include/iptables_common.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/iptables_common.h b/include/iptables_common.h
index 9099667ffa6d..2c27a4b61fcd 100644
--- a/include/iptables_common.h
+++ b/include/iptables_common.h
@@ -43,6 +43,8 @@ extern char *lib_dir;
   extern void init_extensions(void);
 #endif
 
+#include <sys/types.h>
+
 #define __be32	u_int32_t
 #define __le32	u_int32_t
 #define __be16	u_int16_t
-- 
2.11.0

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

* Re: [PATCH 2/2] Add missing <sys/types.h> include
  2017-05-22 13:27 ` [PATCH 2/2] Add missing <sys/types.h> include Baruch Siach
@ 2017-05-22 17:24   ` Stephen Hemminger
  2017-05-22 20:09     ` Baruch Siach
  0 siblings, 1 reply; 7+ messages in thread
From: Stephen Hemminger @ 2017-05-22 17:24 UTC (permalink / raw)
  To: Baruch Siach; +Cc: netdev, Thomas Petazzoni

On Mon, 22 May 2017 16:27:54 +0300
Baruch Siach <baruch@tkos.co.il> wrote:

> From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> 
> The u_intXX_t types are defined in <sys/types.h>, so it should be
> included before using those types. Otherwise, with certain C
> libraries, the build fails with:
> 
> In file included from ../include/iptables.h:4:0,
>                  from m_ipt.c:18:
> ../include/iptables_common.h:47:16: error: unknown type name ‘u_int32_t’
>  #define __le32 u_int32_t
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> Signed-off-by: Baruch Siach <baruch@tkos.co.il>
> ---
>  include/iptables_common.h | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/include/iptables_common.h b/include/iptables_common.h
> index 9099667ffa6d..2c27a4b61fcd 100644
> --- a/include/iptables_common.h
> +++ b/include/iptables_common.h
> @@ -43,6 +43,8 @@ extern char *lib_dir;
>    extern void init_extensions(void);
>  #endif
>  
> +#include <sys/types.h>
> +
>  #define __be32	u_int32_t
>  #define __le32	u_int32_t
>  #define __be16	u_int16_t

This include file comes from netfilter, so not going to change it in iproute2 repo.

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

* Re: [PATCH 2/2] Add missing <sys/types.h> include
  2017-05-22 17:24   ` Stephen Hemminger
@ 2017-05-22 20:09     ` Baruch Siach
  2017-05-22 20:23       ` Stephen Hemminger
  0 siblings, 1 reply; 7+ messages in thread
From: Baruch Siach @ 2017-05-22 20:09 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev, Thomas Petazzoni

Hi Stephen,

On Mon, May 22, 2017 at 10:24:42AM -0700, Stephen Hemminger wrote:
> On Mon, 22 May 2017 16:27:54 +0300
> Baruch Siach <baruch@tkos.co.il> wrote:
> 
> > From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> > 
> > The u_intXX_t types are defined in <sys/types.h>, so it should be
> > included before using those types. Otherwise, with certain C
> > libraries, the build fails with:
> > 
> > In file included from ../include/iptables.h:4:0,
> >                  from m_ipt.c:18:
> > ../include/iptables_common.h:47:16: error: unknown type name ‘u_int32_t’
> >  #define __le32 u_int32_t
> > 
> > Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> > Signed-off-by: Baruch Siach <baruch@tkos.co.il>
> > ---
> >  include/iptables_common.h | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/include/iptables_common.h b/include/iptables_common.h
> > index 9099667ffa6d..2c27a4b61fcd 100644
> > --- a/include/iptables_common.h
> > +++ b/include/iptables_common.h
> > @@ -43,6 +43,8 @@ extern char *lib_dir;
> >    extern void init_extensions(void);
> >  #endif
> >  
> > +#include <sys/types.h>
> > +
> >  #define __be32	u_int32_t
> >  #define __le32	u_int32_t
> >  #define __be16	u_int16_t
> 
> This include file comes from netfilter, so not going to change it in iproute2 repo.

It turns out that this headers is unused since commit 5cd1adba79d33644 (Update 
to current iptables headers). So this patch is no longer needed.

iptables dropped this file in commit a3732db1280 (Moves all declarations in 
iptables_common.h to xtables.h).

baruch

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch@tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -

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

* Re: [PATCH 2/2] Add missing <sys/types.h> include
  2017-05-22 20:09     ` Baruch Siach
@ 2017-05-22 20:23       ` Stephen Hemminger
  0 siblings, 0 replies; 7+ messages in thread
From: Stephen Hemminger @ 2017-05-22 20:23 UTC (permalink / raw)
  To: Baruch Siach; +Cc: netdev, Thomas Petazzoni

On Mon, 22 May 2017 23:09:23 +0300
Baruch Siach <baruch@tkos.co.il> wrote:

> Hi Stephen,
> 
> On Mon, May 22, 2017 at 10:24:42AM -0700, Stephen Hemminger wrote:
> > On Mon, 22 May 2017 16:27:54 +0300
> > Baruch Siach <baruch@tkos.co.il> wrote:
> >   
> > > From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> > > 
> > > The u_intXX_t types are defined in <sys/types.h>, so it should be
> > > included before using those types. Otherwise, with certain C
> > > libraries, the build fails with:
> > > 
> > > In file included from ../include/iptables.h:4:0,
> > >                  from m_ipt.c:18:
> > > ../include/iptables_common.h:47:16: error: unknown type name ‘u_int32_t’
> > >  #define __le32 u_int32_t
> > > 
> > > Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> > > Signed-off-by: Baruch Siach <baruch@tkos.co.il>
> > > ---
> > >  include/iptables_common.h | 2 ++
> > >  1 file changed, 2 insertions(+)
> > > 
> > > diff --git a/include/iptables_common.h b/include/iptables_common.h
> > > index 9099667ffa6d..2c27a4b61fcd 100644
> > > --- a/include/iptables_common.h
> > > +++ b/include/iptables_common.h
> > > @@ -43,6 +43,8 @@ extern char *lib_dir;
> > >    extern void init_extensions(void);
> > >  #endif
> > >  
> > > +#include <sys/types.h>
> > > +
> > >  #define __be32	u_int32_t
> > >  #define __le32	u_int32_t
> > >  #define __be16	u_int16_t  
> > 
> > This include file comes from netfilter, so not going to change it in iproute2 repo.  
> 
> It turns out that this headers is unused since commit 5cd1adba79d33644 (Update 
> to current iptables headers). So this patch is no longer needed.
> 
> iptables dropped this file in commit a3732db1280 (Moves all declarations in 
> iptables_common.h to xtables.h).
> 
> baruch
> 

Ok removed the file

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

* Re: [PATCH 1/2] ip: include libc headers first
  2017-05-22 13:27 [PATCH 1/2] ip: include libc headers first Baruch Siach
  2017-05-22 13:27 ` [PATCH 2/2] Add missing <sys/types.h> include Baruch Siach
@ 2017-05-31  0:31 ` Stephen Hemminger
  2017-05-31 20:59   ` Baruch Siach
  1 sibling, 1 reply; 7+ messages in thread
From: Stephen Hemminger @ 2017-05-31  0:31 UTC (permalink / raw)
  To: Baruch Siach; +Cc: netdev

On Mon, 22 May 2017 16:27:53 +0300
Baruch Siach <baruch@tkos.co.il> wrote:

> Including libc headers first helps as a workaround to redefinition of struct
> ethhdr with a suitably patched musl libc that suppresses the kernel
> if_ether.h.
> 
> Signed-off-by: Baruch Siach <baruch@tkos.co.il>
> ---
>  ip/iplink_bridge.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/ip/iplink_bridge.c b/ip/iplink_bridge.c
> index 818b43c89b5b..cccdec1c203a 100644
> --- a/ip/iplink_bridge.c
> +++ b/ip/iplink_bridge.c
> @@ -13,9 +13,9 @@
>  #include <stdlib.h>
>  #include <string.h>
>  #include <netinet/in.h>
> +#include <netinet/ether.h>
>  #include <linux/if_link.h>
>  #include <linux/if_bridge.h>
> -#include <netinet/ether.h>
>  #include <net/if.h>
>  
>  #include "rt_names.h"

Applied.

Next time please fix the Subject line.  You implied two patches by using 1/2
but only one was sent.

It is easier for me if you include iproute2 in subject since then it goes into a
separate folder.

Subject: [PATCH iproute2] ip: include libc headers first

or if intended for net-next

Subject: [PATCH iproute2 net-next] ip: add magic VRF support

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

* Re: [PATCH 1/2] ip: include libc headers first
  2017-05-31  0:31 ` [PATCH 1/2] ip: include libc headers first Stephen Hemminger
@ 2017-05-31 20:59   ` Baruch Siach
  0 siblings, 0 replies; 7+ messages in thread
From: Baruch Siach @ 2017-05-31 20:59 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev

Hi Stephen,

On Tue, May 30, 2017 at 05:31:51PM -0700, Stephen Hemminger wrote:
> On Mon, 22 May 2017 16:27:53 +0300
> Baruch Siach <baruch@tkos.co.il> wrote:
> 
> > Including libc headers first helps as a workaround to redefinition of struct
> > ethhdr with a suitably patched musl libc that suppresses the kernel
> > if_ether.h.
> > 
> > Signed-off-by: Baruch Siach <baruch@tkos.co.il>
> > ---
> >  ip/iplink_bridge.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/ip/iplink_bridge.c b/ip/iplink_bridge.c
> > index 818b43c89b5b..cccdec1c203a 100644
> > --- a/ip/iplink_bridge.c
> > +++ b/ip/iplink_bridge.c
> > @@ -13,9 +13,9 @@
> >  #include <stdlib.h>
> >  #include <string.h>
> >  #include <netinet/in.h>
> > +#include <netinet/ether.h>
> >  #include <linux/if_link.h>
> >  #include <linux/if_bridge.h>
> > -#include <netinet/ether.h>
> >  #include <net/if.h>
> >  
> >  #include "rt_names.h"
> 
> Applied.

Thanks.

> Next time please fix the Subject line.  You implied two patches by using 1/2
> but only one was sent.

You have seen and responded[1] to patch 2/2 in this series. Eventually that 
patch turned out to be redundant, so you committed cda81a4ea5e (include: 
remove no longer used iptables_common.h) instead.

> It is easier for me if you include iproute2 in subject since then it goes 
> into a separate folder.
> 
> Subject: [PATCH iproute2] ip: include libc headers first
> 
> or if intended for net-next
> 
> Subject: [PATCH iproute2 net-next] ip: add magic VRF support

I will remember that for next time.

[1] http://marc.info/?l=linux-netdev&m=149547389506859

baruch

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch@tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -

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

end of thread, other threads:[~2017-05-31 20:59 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-22 13:27 [PATCH 1/2] ip: include libc headers first Baruch Siach
2017-05-22 13:27 ` [PATCH 2/2] Add missing <sys/types.h> include Baruch Siach
2017-05-22 17:24   ` Stephen Hemminger
2017-05-22 20:09     ` Baruch Siach
2017-05-22 20:23       ` Stephen Hemminger
2017-05-31  0:31 ` [PATCH 1/2] ip: include libc headers first Stephen Hemminger
2017-05-31 20:59   ` Baruch Siach

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.