netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH iproute2 0/2] Build fixes for the musl C library
@ 2015-11-19 21:05 Thomas Petazzoni
  2015-11-19 21:05 ` [PATCH iproute2 1/2] Avoid in6_addr redefinition Thomas Petazzoni
  2015-11-19 21:05 ` [PATCH iproute2 2/2] Add missing <sys/types.h> include Thomas Petazzoni
  0 siblings, 2 replies; 7+ messages in thread
From: Thomas Petazzoni @ 2015-11-19 21:05 UTC (permalink / raw)
  To: netdev; +Cc: Thomas Petazzoni

Hello,

The following two patches fixing build issues that occur when trying
to build iproute2 with the musl C library (http://musl-libc.org).

Thanks,

Thomas

Thomas Petazzoni (2):
  Avoid in6_addr redefinition
  Add missing <sys/types.h> include

 include/iptables_common.h            | 2 ++
 include/libiptc/ipt_kernel_headers.h | 2 --
 include/linux/if_bridge.h            | 1 -
 include/linux/netfilter.h            | 2 --
 include/linux/xfrm.h                 | 1 -
 5 files changed, 2 insertions(+), 6 deletions(-)

-- 
2.6.3

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

* [PATCH iproute2 1/2] Avoid in6_addr redefinition
  2015-11-19 21:05 [PATCH iproute2 0/2] Build fixes for the musl C library Thomas Petazzoni
@ 2015-11-19 21:05 ` Thomas Petazzoni
  2015-11-19 22:32   ` Stephen Hemminger
  2015-11-19 21:05 ` [PATCH iproute2 2/2] Add missing <sys/types.h> include Thomas Petazzoni
  1 sibling, 1 reply; 7+ messages in thread
From: Thomas Petazzoni @ 2015-11-19 21:05 UTC (permalink / raw)
  To: netdev; +Cc: Thomas Petazzoni

Due to both <netinet/in.h> and <linux/in6.h> being included, the
in6_addr is being redefined: once from the C library headers and once
from the kernel headers. This causes some build failures with for
example the musl C library:

In file included from ../include/linux/xfrm.h:4:0,
                 from xfrm.h:29,
                 from ipxfrm.c:39:
../include/linux/in6.h:32:8: error: redefinition of ‘struct in6_addr’
 struct in6_addr {
        ^
In file included from .../output/host/usr/x86_64-buildroot-linux-musl/sysroot/usr/include/netdb.h:9:0,
                 from ipxfrm.c:34:
.../output/host/usr/x86_64-buildroot-linux-musl/sysroot/usr/include/netinet/in.h:24:8: note: originally defined here
 struct in6_addr
        ^

In order to fix this, use just the C library header <netinet/in.h>.

Original patch taken from
http://git.alpinelinux.org/cgit/aports/tree/main/iproute2/musl-fixes.patch.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 include/libiptc/ipt_kernel_headers.h | 2 --
 include/linux/if_bridge.h            | 1 -
 include/linux/netfilter.h            | 2 --
 include/linux/xfrm.h                 | 1 -
 4 files changed, 6 deletions(-)

diff --git a/include/libiptc/ipt_kernel_headers.h b/include/libiptc/ipt_kernel_headers.h
index 7e87828..9566be5 100644
--- a/include/libiptc/ipt_kernel_headers.h
+++ b/include/libiptc/ipt_kernel_headers.h
@@ -15,12 +15,10 @@
 #else /* libc5 */
 #include <sys/socket.h>
 #include <linux/ip.h>
-#include <linux/in.h>
 #include <linux/if.h>
 #include <linux/icmp.h>
 #include <linux/tcp.h>
 #include <linux/udp.h>
 #include <linux/types.h>
-#include <linux/in6.h>
 #endif
 #endif
diff --git a/include/linux/if_bridge.h b/include/linux/if_bridge.h
index ee197a3..f823aa4 100644
--- a/include/linux/if_bridge.h
+++ b/include/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"
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h
index b71b4c9..3e4e6ae 100644
--- a/include/linux/netfilter.h
+++ b/include/linux/netfilter.h
@@ -4,8 +4,6 @@
 #include <linux/types.h>
 
 #include <linux/sysctl.h>
-#include <linux/in.h>
-#include <linux/in6.h>
 
 /* Responses from hook functions. */
 #define NF_DROP 0
diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h
index b8f5451..a9761a5 100644
--- a/include/linux/xfrm.h
+++ b/include/linux/xfrm.h
@@ -1,7 +1,6 @@
 #ifndef _LINUX_XFRM_H
 #define _LINUX_XFRM_H
 
-#include <linux/in6.h>
 #include <linux/types.h>
 
 /* All of the structures in this file may not change size as they are
-- 
2.6.3

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

* [PATCH iproute2 2/2] Add missing <sys/types.h> include
  2015-11-19 21:05 [PATCH iproute2 0/2] Build fixes for the musl C library Thomas Petazzoni
  2015-11-19 21:05 ` [PATCH iproute2 1/2] Avoid in6_addr redefinition Thomas Petazzoni
@ 2015-11-19 21:05 ` Thomas Petazzoni
  2015-11-19 22:31   ` Stephen Hemminger
  1 sibling, 1 reply; 7+ messages in thread
From: Thomas Petazzoni @ 2015-11-19 21:05 UTC (permalink / raw)
  To: netdev; +Cc: Thomas Petazzoni

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>
---
 include/iptables_common.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/iptables_common.h b/include/iptables_common.h
index 9099667..2c27a4b 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.6.3

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

* Re: [PATCH iproute2 2/2] Add missing <sys/types.h> include
  2015-11-19 21:05 ` [PATCH iproute2 2/2] Add missing <sys/types.h> include Thomas Petazzoni
@ 2015-11-19 22:31   ` Stephen Hemminger
  0 siblings, 0 replies; 7+ messages in thread
From: Stephen Hemminger @ 2015-11-19 22:31 UTC (permalink / raw)
  To: Thomas Petazzoni; +Cc: netdev

On Thu, 19 Nov 2015 22:05:40 +0100
Thomas Petazzoni <thomas.petazzoni@free-electrons.com> wrote:

> 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>
> ---
>  include/iptables_common.h | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/include/iptables_common.h b/include/iptables_common.h
> index 9099667..2c27a4b 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

I would prefer you send this one through the iptables team
since that header file came from there.

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

* Re: [PATCH iproute2 1/2] Avoid in6_addr redefinition
  2015-11-19 21:05 ` [PATCH iproute2 1/2] Avoid in6_addr redefinition Thomas Petazzoni
@ 2015-11-19 22:32   ` Stephen Hemminger
  0 siblings, 0 replies; 7+ messages in thread
From: Stephen Hemminger @ 2015-11-19 22:32 UTC (permalink / raw)
  To: Thomas Petazzoni; +Cc: netdev

On Thu, 19 Nov 2015 22:05:39 +0100
Thomas Petazzoni <thomas.petazzoni@free-electrons.com> wrote:

> diff --git a/include/libiptc/ipt_kernel_headers.h b/include/libiptc/ipt_kernel_headers.h
> index 7e87828..9566be5 100644
> --- a/include/libiptc/ipt_kernel_headers.h
> +++ b/include/libiptc/ipt_kernel_headers.h
> @@ -15,12 +15,10 @@
>  #else /* libc5 */
>  #include <sys/socket.h>
>  #include <linux/ip.h>
> -#include <linux/in.h>
>  #include <linux/if.h>
>  #include <linux/icmp.h>
>  #include <linux/tcp.h>
>  #include <linux/udp.h>
>  #include <linux/types.h>
> -#include <linux/in6.h>
>  #endif
>  #endif

This header file comes from iptables. Please fix there, otherwise
on next time someone does merge from there it will break.

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

* Re: [PATCH iproute2 1/2] Avoid in6_addr redefinition
@ 2016-01-03 20:10 Felix Janda
  2016-01-03 23:16 ` Stephen Hemminger
  0 siblings, 1 reply; 7+ messages in thread
From: Felix Janda @ 2016-01-03 20:10 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: Thomas Petazzoni, netdev

On 2015-11-19 22:32:50 GMT Stephen Hemminger <stephen@networkplumber.org> wrote:
> This header file comes from iptables. Please fix there, otherwise
> on next time someone does merge from there it will break.

It is already fixed in iptables:

https://git.netfilter.org/iptables/commit/include/libiptc/ipt_kernel_headers.h?id=0bb1859e2d6dd79a0a59c3ee65f6a78cba118b86

Please sync the header with iptables.

Felix

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

* Re: [PATCH iproute2 1/2] Avoid in6_addr redefinition
  2016-01-03 20:10 [PATCH iproute2 1/2] Avoid in6_addr redefinition Felix Janda
@ 2016-01-03 23:16 ` Stephen Hemminger
  0 siblings, 0 replies; 7+ messages in thread
From: Stephen Hemminger @ 2016-01-03 23:16 UTC (permalink / raw)
  To: Felix Janda; +Cc: Thomas Petazzoni, netdev

On Sun, 3 Jan 2016 21:10:28 +0100
Felix Janda <felix.janda@posteo.de> wrote:

> On 2015-11-19 22:32:50 GMT Stephen Hemminger <stephen@networkplumber.org> wrote:
> > This header file comes from iptables. Please fix there, otherwise
> > on next time someone does merge from there it will break.
> 
> It is already fixed in iptables:
> 
> https://git.netfilter.org/iptables/commit/include/libiptc/ipt_kernel_headers.h?id=0bb1859e2d6dd79a0a59c3ee65f6a78cba118b86
> 
> Please sync the header with iptables.
> 
> Felix

Ok, I resynced all the iptables headers (into net-next branch).

Compile tested only. I don't use this, it would be good if someone
who actually uses xtables would test.

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

end of thread, other threads:[~2016-01-03 23:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-19 21:05 [PATCH iproute2 0/2] Build fixes for the musl C library Thomas Petazzoni
2015-11-19 21:05 ` [PATCH iproute2 1/2] Avoid in6_addr redefinition Thomas Petazzoni
2015-11-19 22:32   ` Stephen Hemminger
2015-11-19 21:05 ` [PATCH iproute2 2/2] Add missing <sys/types.h> include Thomas Petazzoni
2015-11-19 22:31   ` Stephen Hemminger
  -- strict thread matches above, loose matches on Subject: below --
2016-01-03 20:10 [PATCH iproute2 1/2] Avoid in6_addr redefinition Felix Janda
2016-01-03 23:16 ` Stephen Hemminger

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).