0001-Avoid-in6_addr-redefinition.patch 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. Due to both <netinet/in.h> and <linux/in6.h> being included, the
  9. in6_addr is being redefined: once from the C library headers and once
  10. from the kernel headers. This causes some build failures with for
  11. example the musl C library:
  12. In file included from ../include/linux/xfrm.h:4:0,
  13. from xfrm.h:29,
  14. from ipxfrm.c:39:
  15. ../include/linux/in6.h:32:8: error: redefinition of ‘struct in6_addr’
  16. struct in6_addr {
  17. ^
  18. In file included from .../output/host/usr/x86_64-buildroot-linux-musl/sysroot/usr/include/netdb.h:9:0,
  19. from ipxfrm.c:34:
  20. .../output/host/usr/x86_64-buildroot-linux-musl/sysroot/usr/include/netinet/in.h:24:8: note: originally defined here
  21. struct in6_addr
  22. ^
  23. In order to fix this, use just the C library header <netinet/in.h>.
  24. Original patch taken from
  25. http://git.alpinelinux.org/cgit/aports/tree/main/iproute2/musl-fixes.patch.
  26. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  27. [Gustavo: drop ipt_kernel_headers.h chunk since no longer necessary]
  28. Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
  29. ---
  30. include/linux/if_bridge.h | 1 -
  31. include/linux/netfilter.h | 2 --
  32. include/linux/xfrm.h | 1 -
  33. 3 files changed, 4 deletions(-)
  34. diff --git a/include/linux/if_bridge.h b/include/linux/if_bridge.h
  35. index ee197a3..f823aa4 100644
  36. --- a/include/linux/if_bridge.h
  37. +++ b/include/linux/if_bridge.h
  38. @@ -15,7 +15,6 @@
  39. #include <linux/types.h>
  40. #include <linux/if_ether.h>
  41. -#include <linux/in6.h>
  42. #define SYSFS_BRIDGE_ATTR "bridge"
  43. #define SYSFS_BRIDGE_FDB "brforward"
  44. diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h
  45. index b71b4c9..3e4e6ae 100644
  46. --- a/include/linux/netfilter.h
  47. +++ b/include/linux/netfilter.h
  48. @@ -4,8 +4,6 @@
  49. #include <linux/types.h>
  50. #include <linux/sysctl.h>
  51. -#include <linux/in.h>
  52. -#include <linux/in6.h>
  53. /* Responses from hook functions. */
  54. #define NF_DROP 0
  55. diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h
  56. index b8f5451..a9761a5 100644
  57. --- a/include/linux/xfrm.h
  58. +++ b/include/linux/xfrm.h
  59. @@ -1,7 +1,6 @@
  60. #ifndef _LINUX_XFRM_H
  61. #define _LINUX_XFRM_H
  62. -#include <linux/in6.h>
  63. #include <linux/types.h>
  64. /* All of the structures in this file may not change size as they are
  65. --
  66. 2.6.3