summaryrefslogtreecommitdiffstats
path: root/package/iproute2/iproute2-optional-ipv6.patch
blob: ef22c22129dfae86b42e5e7b32500029e64fd315 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
[PATCH] fix build on uClibc without IPv6 support

Disable IPv6 support code when building with uClibc configured without IPv6
support.

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
---
 ip/ip6tunnel.c |    6 ++++++
 ip/ipprefix.c  |    8 ++++++++
 ip/iptunnel.c  |    6 ++++++
 3 files changed, 20 insertions(+)

Index: iproute2-2.6.37-orig/ip/ip6tunnel.c
===================================================================
--- iproute2-2.6.37-orig.orig/ip/ip6tunnel.c
+++ iproute2-2.6.37-orig/ip/ip6tunnel.c
@@ -20,6 +20,10 @@
  *	Masahide NAKAMURA @USAGI
  */
 
+#include <features.h>
+#if defined(__UCLIBC__) && !defined (__UCLIBC_HAS_IPV6__)
+#else
+
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
@@ -410,3 +414,5 @@ int do_ip6tunnel(int argc, char **argv)
 	fprintf(stderr, "Command \"%s\" is unknown, try \"ip -f inet6 tunnel help\".\n", *argv);
 	exit(-1);
 }
+
+#endif /* no ipv6 */
Index: iproute2-2.6.37-orig/ip/ipprefix.c
===================================================================
--- iproute2-2.6.37-orig.orig/ip/ipprefix.c
+++ iproute2-2.6.37-orig/ip/ipprefix.c
@@ -22,11 +22,17 @@
  * Authors:
  *	Masahide NAKAMURA @USAGI
  */
+#include <features.h>
+#if defined(__UCLIBC__) && !defined (__UCLIBC_HAS_IPV6__)
+#define NO_IPV6
+#endif
 
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#ifndef NO_IPV6
 #include <netinet/icmp6.h>
+#endif
 #include "utils.h"
 
 /* prefix flags; see kernel's net/ipv6/addrconf.c and include/net/if_inet6.h */
@@ -62,10 +68,12 @@ int print_prefix(const struct sockaddr_n
 		fprintf(stderr, "wrong family %d\n", prefix->prefix_family);
 		return 0;
 	}
+#ifdef ND_OPT_PREFIX_INFORMATION
 	if (prefix->prefix_type != ND_OPT_PREFIX_INFORMATION) {
 		fprintf(stderr, "wrong ND type %d\n", prefix->prefix_type);
 		return 0;
 	}
+#endif
 
 	parse_rtattr(tb, RTA_MAX, RTM_RTA(prefix), len);
 
Index: iproute2-2.6.37-orig/ip/iptunnel.c
===================================================================
--- iproute2-2.6.37-orig.orig/ip/iptunnel.c
+++ iproute2-2.6.37-orig/ip/iptunnel.c
@@ -9,6 +9,10 @@
  * Authors:	Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
  *
  */
+#include <features.h>
+#if defined(__UCLIBC__) && !defined (__UCLIBC_HAS_IPV6__)
+#define NO_IPV6
+#endif
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -601,8 +605,10 @@ int do_iptunnel(int argc, char **argv)
 	 * protocol-independent because of unarranged structure between
 	 * IPv4 and IPv6.
 	 */
+#ifndef NO_IPV6
 	case AF_INET6:
 		return do_ip6tunnel(argc, argv);
+#endif
 	default:
 		fprintf(stderr, "Unsupported family:%d\n", preferred_family);
 		exit(-1);