iproute2-optional-ipv6.patch 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. [PATCH] fix build on uClibc without IPv6 support
  2. Disable IPv6 support code when building with uClibc configured without IPv6
  3. support.
  4. Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
  5. ---
  6. ip/ip6tunnel.c | 6 ++++++
  7. ip/ipprefix.c | 8 ++++++++
  8. ip/iptunnel.c | 6 ++++++
  9. 3 files changed, 20 insertions(+)
  10. Index: iproute2-2.6.37-orig/ip/ip6tunnel.c
  11. ===================================================================
  12. --- iproute2-2.6.37-orig.orig/ip/ip6tunnel.c
  13. +++ iproute2-2.6.37-orig/ip/ip6tunnel.c
  14. @@ -20,6 +20,10 @@
  15. * Masahide NAKAMURA @USAGI
  16. */
  17. +#include <features.h>
  18. +#if defined(__UCLIBC__) && !defined (__UCLIBC_HAS_IPV6__)
  19. +#else
  20. +
  21. #include <stdio.h>
  22. #include <string.h>
  23. #include <stdlib.h>
  24. @@ -410,3 +414,5 @@ int do_ip6tunnel(int argc, char **argv)
  25. fprintf(stderr, "Command \"%s\" is unknown, try \"ip -f inet6 tunnel help\".\n", *argv);
  26. exit(-1);
  27. }
  28. +
  29. +#endif /* no ipv6 */
  30. Index: iproute2-2.6.37-orig/ip/ipprefix.c
  31. ===================================================================
  32. --- iproute2-2.6.37-orig.orig/ip/ipprefix.c
  33. +++ iproute2-2.6.37-orig/ip/ipprefix.c
  34. @@ -22,11 +22,17 @@
  35. * Authors:
  36. * Masahide NAKAMURA @USAGI
  37. */
  38. +#include <features.h>
  39. +#if defined(__UCLIBC__) && !defined (__UCLIBC_HAS_IPV6__)
  40. +#define NO_IPV6
  41. +#endif
  42. #include <stdio.h>
  43. #include <stdlib.h>
  44. #include <string.h>
  45. +#ifndef NO_IPV6
  46. #include <netinet/icmp6.h>
  47. +#endif
  48. #include "utils.h"
  49. /* prefix flags; see kernel's net/ipv6/addrconf.c and include/net/if_inet6.h */
  50. @@ -62,10 +68,12 @@ int print_prefix(const struct sockaddr_n
  51. fprintf(stderr, "wrong family %d\n", prefix->prefix_family);
  52. return 0;
  53. }
  54. +#ifdef ND_OPT_PREFIX_INFORMATION
  55. if (prefix->prefix_type != ND_OPT_PREFIX_INFORMATION) {
  56. fprintf(stderr, "wrong ND type %d\n", prefix->prefix_type);
  57. return 0;
  58. }
  59. +#endif
  60. parse_rtattr(tb, RTA_MAX, RTM_RTA(prefix), len);
  61. Index: iproute2-2.6.37-orig/ip/iptunnel.c
  62. ===================================================================
  63. --- iproute2-2.6.37-orig.orig/ip/iptunnel.c
  64. +++ iproute2-2.6.37-orig/ip/iptunnel.c
  65. @@ -9,6 +9,10 @@
  66. * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
  67. *
  68. */
  69. +#include <features.h>
  70. +#if defined(__UCLIBC__) && !defined (__UCLIBC_HAS_IPV6__)
  71. +#define NO_IPV6
  72. +#endif
  73. #include <stdio.h>
  74. #include <stdlib.h>
  75. @@ -601,8 +605,10 @@ int do_iptunnel(int argc, char **argv)
  76. * protocol-independent because of unarranged structure between
  77. * IPv4 and IPv6.
  78. */
  79. +#ifndef NO_IPV6
  80. case AF_INET6:
  81. return do_ip6tunnel(argc, argv);
  82. +#endif
  83. default:
  84. fprintf(stderr, "Unsupported family:%d\n", preferred_family);
  85. exit(-1);