Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 1 | From 48596709d8ab59727b79a5c6db33ebb251c36543 Mon Sep 17 00:00:00 2001 |
| 2 | From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> |
| 3 | Date: Thu, 19 Nov 2015 17:44:25 +0100 |
| 4 | Subject: [PATCH] Avoid in6_addr redefinition |
| 5 | MIME-Version: 1.0 |
| 6 | Content-Type: text/plain; charset=UTF-8 |
| 7 | Content-Transfer-Encoding: 8bit |
| 8 | |
| 9 | Due to both <netinet/in.h> and <linux/in6.h> being included, the |
| 10 | in6_addr is being redefined: once from the C library headers and once |
| 11 | from the kernel headers. This causes some build failures with for |
| 12 | example the musl C library: |
| 13 | |
| 14 | In file included from ../include/linux/xfrm.h:4:0, |
| 15 | from xfrm.h:29, |
| 16 | from ipxfrm.c:39: |
| 17 | ../include/linux/in6.h:32:8: error: redefinition of ‘struct in6_addr’ |
| 18 | struct in6_addr { |
| 19 | ^ |
| 20 | In file included from .../output/host/usr/x86_64-buildroot-linux-musl/sysroot/usr/include/netdb.h:9:0, |
| 21 | from ipxfrm.c:34: |
| 22 | .../output/host/usr/x86_64-buildroot-linux-musl/sysroot/usr/include/netinet/in.h:24:8: note: originally defined here |
| 23 | struct in6_addr |
| 24 | ^ |
| 25 | |
| 26 | In order to fix this, use just the C library header <netinet/in.h>. |
| 27 | |
| 28 | Original patch taken from |
| 29 | http://git.alpinelinux.org/cgit/aports/tree/main/iproute2/musl-fixes.patch. |
| 30 | |
| 31 | Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> |
| 32 | --- |
| 33 | Upstream-Status: Pending |
| 34 | |
| 35 | include/libiptc/ipt_kernel_headers.h | 2 -- |
| 36 | include/linux/if_bridge.h | 1 - |
| 37 | include/linux/netfilter.h | 2 -- |
| 38 | include/linux/xfrm.h | 1 - |
| 39 | 4 files changed, 6 deletions(-) |
| 40 | |
| 41 | diff --git a/include/libiptc/ipt_kernel_headers.h b/include/libiptc/ipt_kernel_headers.h |
| 42 | index 7e87828..9566be5 100644 |
| 43 | --- a/include/libiptc/ipt_kernel_headers.h |
| 44 | +++ b/include/libiptc/ipt_kernel_headers.h |
| 45 | @@ -15,12 +15,10 @@ |
| 46 | #else /* libc5 */ |
| 47 | #include <sys/socket.h> |
| 48 | #include <linux/ip.h> |
| 49 | -#include <linux/in.h> |
| 50 | #include <linux/if.h> |
| 51 | #include <linux/icmp.h> |
| 52 | #include <linux/tcp.h> |
| 53 | #include <linux/udp.h> |
| 54 | #include <linux/types.h> |
| 55 | -#include <linux/in6.h> |
| 56 | #endif |
| 57 | #endif |
| 58 | diff --git a/include/linux/if_bridge.h b/include/linux/if_bridge.h |
| 59 | index ee197a3..f823aa4 100644 |
| 60 | --- a/include/linux/if_bridge.h |
| 61 | +++ b/include/linux/if_bridge.h |
| 62 | @@ -15,7 +15,6 @@ |
| 63 | |
| 64 | #include <linux/types.h> |
| 65 | #include <linux/if_ether.h> |
| 66 | -#include <linux/in6.h> |
| 67 | |
| 68 | #define SYSFS_BRIDGE_ATTR "bridge" |
| 69 | #define SYSFS_BRIDGE_FDB "brforward" |
| 70 | diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h |
| 71 | index b71b4c9..3e4e6ae 100644 |
| 72 | --- a/include/linux/netfilter.h |
| 73 | +++ b/include/linux/netfilter.h |
| 74 | @@ -4,8 +4,6 @@ |
| 75 | #include <linux/types.h> |
| 76 | |
| 77 | #include <linux/sysctl.h> |
| 78 | -#include <linux/in.h> |
| 79 | -#include <linux/in6.h> |
| 80 | |
| 81 | /* Responses from hook functions. */ |
| 82 | #define NF_DROP 0 |
| 83 | diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h |
| 84 | index b8f5451..a9761a5 100644 |
| 85 | --- a/include/linux/xfrm.h |
| 86 | +++ b/include/linux/xfrm.h |
| 87 | @@ -1,7 +1,6 @@ |
| 88 | #ifndef _LINUX_XFRM_H |
| 89 | #define _LINUX_XFRM_H |
| 90 | |
| 91 | -#include <linux/in6.h> |
| 92 | #include <linux/types.h> |
| 93 | |
| 94 | /* All of the structures in this file may not change size as they are |
| 95 | -- |
| 96 | 2.6.3 |
| 97 | |