2013-12-02 01:28:33 +01:00
|
|
|
Disable IPv6 support code in vxlan when building with uClibc configured without
|
|
|
|
IPv6 support.
|
|
|
|
|
|
|
|
Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
|
|
|
|
|
2014-04-14 17:46:08 +02:00
|
|
|
diff -Nura iproute2-3.14.0/ip/iplink_vxlan.c iproute2-3.14.0-noipv6/ip/iplink_vxlan.c
|
|
|
|
--- iproute2-3.14.0/ip/iplink_vxlan.c 2014-04-11 21:48:41.000000000 -0300
|
|
|
|
+++ iproute2-3.14.0-noipv6/ip/iplink_vxlan.c 2014-04-14 08:36:22.638235721 -0300
|
2013-12-02 01:28:33 +01:00
|
|
|
@@ -9,6 +9,11 @@
|
|
|
|
* Authors: Stephen Hemminger <shemminger@vyatta.com
|
|
|
|
*/
|
|
|
|
|
|
|
|
+#include <features.h>
|
|
|
|
+#if defined(__UCLIBC__) && !defined (__UCLIBC_HAS_IPV6__)
|
|
|
|
+#define NO_IPV6
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
2014-04-14 17:46:08 +02:00
|
|
|
@@ -188,12 +193,14 @@
|
2013-12-02 01:28:33 +01:00
|
|
|
return -1;
|
|
|
|
}
|
2014-04-14 17:46:08 +02:00
|
|
|
|
2013-12-02 01:28:33 +01:00
|
|
|
+#ifndef NO_IPV6
|
|
|
|
if ((gaddr && daddr) ||
|
|
|
|
(memcmp(&gaddr6, &in6addr_any, sizeof(gaddr6)) &&
|
|
|
|
memcmp(&daddr6, &in6addr_any, sizeof(daddr6)))) {
|
|
|
|
fprintf(stderr, "vxlan: both group and remote cannot be specified\n");
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
+#endif
|
2014-04-14 17:46:08 +02:00
|
|
|
|
|
|
|
if (!dst_port_set) {
|
|
|
|
fprintf(stderr, "vxlan: destination port not specified\n"
|
|
|
|
@@ -208,15 +215,19 @@
|
2013-12-02 01:28:33 +01:00
|
|
|
addattr_l(n, 1024, IFLA_VXLAN_GROUP, &gaddr, 4);
|
|
|
|
else if (daddr)
|
|
|
|
addattr_l(n, 1024, IFLA_VXLAN_GROUP, &daddr, 4);
|
|
|
|
+#ifndef NO_IPV6
|
|
|
|
if (memcmp(&gaddr6, &in6addr_any, sizeof(gaddr6)) != 0)
|
|
|
|
addattr_l(n, 1024, IFLA_VXLAN_GROUP6, &gaddr6, sizeof(struct in6_addr));
|
|
|
|
else if (memcmp(&daddr6, &in6addr_any, sizeof(daddr6)) != 0)
|
|
|
|
addattr_l(n, 1024, IFLA_VXLAN_GROUP6, &daddr6, sizeof(struct in6_addr));
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
if (saddr)
|
|
|
|
addattr_l(n, 1024, IFLA_VXLAN_LOCAL, &saddr, 4);
|
|
|
|
+#ifndef NO_IPV6
|
|
|
|
else if (memcmp(&saddr6, &in6addr_any, sizeof(saddr6)) != 0)
|
|
|
|
addattr_l(n, 1024, IFLA_VXLAN_LOCAL6, &saddr6, sizeof(struct in6_addr));
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
if (link)
|
|
|
|
addattr32(n, 1024, IFLA_VXLAN_LINK, link);
|
2014-04-14 17:46:08 +02:00
|
|
|
@@ -275,6 +286,7 @@
|
2013-12-02 01:28:33 +01:00
|
|
|
} else if (tb[IFLA_VXLAN_GROUP6]) {
|
|
|
|
struct in6_addr addr;
|
|
|
|
memcpy(&addr, RTA_DATA(tb[IFLA_VXLAN_GROUP6]), sizeof(struct in6_addr));
|
2014-04-14 17:46:08 +02:00
|
|
|
+#ifndef NO_IPV6
|
|
|
|
if (memcmp(&addr, &in6addr_any, sizeof(addr)) != 0) {
|
|
|
|
if (IN6_IS_ADDR_MULTICAST(&addr))
|
|
|
|
fprintf(f, "group %s ",
|
|
|
|
@@ -283,6 +295,7 @@
|
2013-12-02 01:28:33 +01:00
|
|
|
fprintf(f, "remote %s ",
|
|
|
|
format_host(AF_INET6, sizeof(struct in6_addr), &addr, s1, sizeof(s1)));
|
|
|
|
}
|
|
|
|
+#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
if (tb[IFLA_VXLAN_LOCAL]) {
|
2014-04-14 17:46:08 +02:00
|
|
|
@@ -293,9 +306,11 @@
|
2013-12-02 01:28:33 +01:00
|
|
|
} else if (tb[IFLA_VXLAN_LOCAL6]) {
|
|
|
|
struct in6_addr addr;
|
|
|
|
memcpy(&addr, RTA_DATA(tb[IFLA_VXLAN_LOCAL6]), sizeof(struct in6_addr));
|
2014-04-14 17:46:08 +02:00
|
|
|
+#ifndef NO_IPV6
|
2013-12-02 01:28:33 +01:00
|
|
|
if (memcmp(&addr, &in6addr_any, sizeof(addr)) != 0)
|
|
|
|
fprintf(f, "local %s ",
|
|
|
|
format_host(AF_INET6, sizeof(struct in6_addr), &addr, s1, sizeof(s1)));
|
|
|
|
+#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
if (tb[IFLA_VXLAN_LINK] &&
|