diff mbox

[2/2] Add missing <sys/types.h> include

Message ID 5cdba9c8dc972d25219517ade6129faf73f459b3.1495459674.git.baruch@tkos.co.il
State Not Applicable, archived
Delegated to: stephen hemminger
Headers show

Commit Message

Baruch Siach May 22, 2017, 1:27 p.m. UTC
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(+)

Comments

Stephen Hemminger May 22, 2017, 5:24 p.m. UTC | #1
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.
Baruch Siach May 22, 2017, 8:09 p.m. UTC | #2
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
Stephen Hemminger May 22, 2017, 8:23 p.m. UTC | #3
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
diff mbox

Patch

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