Skip to contentSkip to conversation

vxlan: add ipv6 support

PATCH Applied Cong Wang 2 participants 2 messages Oct 17, 2013 – Oct 30, 2013

Subsystems (3)
lore
Share & tools
lore

Cong Wang

author
#0 lore raw

PATCH v2 1/1 vxlan: add ipv6 support

The kernel already supports it, so add the support to iproute2 as well.

Cc Stephen Hemminger <[email protected]>

---
v2: use a helper

include/utils.h +1 -0
index 24ff19f..a3e310e 100644
@@ -151,6 +151,7 @@ int print_timestamp(FILE *fp);
 extern int cmdlineno;
 extern ssize_t getcmdline(char **line, size_t *len, FILE *in);
 extern int makeargs(char *line, char *argv[], int maxargs);
+extern int inet_get_addr(const char *src, __u32 *dst, struct in6_addr *dst6);
 
 struct iplink_req;
 int iplink_parse(int argc, char **argv, struct iplink_req *req,
ip/iplink_vxlan.c +49 -10

103 lines not on this page · raw message

lib/utils.c +8 -0
index dae1b51..4e9c719 100644
@@ -868,3 +868,11 @@ int makeargs(char *line, char *argv[], int maxargs)
 
 	return argc;
 }
+
+int inet_get_addr(const char *src, __u32 *dst, struct in6_addr *dst6)
+{
+	if (strchr(src, ':'))
+		return inet_pton(AF_INET6, src, dst6);
+	else
+		return inet_pton(AF_INET, src, dst);
+}