smap: smap_add_ipv6 adds IPv4-mapped addresses as IPv4
authorThadeu Lima de Souza Cascardo <cascardo@redhat.com>
Wed, 25 Nov 2015 13:31:07 +0000 (11:31 -0200)
committerBen Pfaff <blp@ovn.org>
Mon, 30 Nov 2015 18:11:02 +0000 (10:11 -0800)
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
lib/smap.c

index 2c41013..07dd23a 100644 (file)
@@ -19,6 +19,7 @@
 
 #include "hash.h"
 #include "json.h"
+#include "packets.h"
 #include "uuid.h"
 
 static struct smap_node *smap_add__(struct smap *, char *, void *,
@@ -101,8 +102,7 @@ void
 smap_add_ipv6(struct smap *smap, const char *key, struct in6_addr *addr)
 {
     char buf[INET6_ADDRSTRLEN];
-
-    inet_ntop(AF_INET6, addr, buf, sizeof buf);
+    ipv6_string_mapped(buf, addr);
     smap_add(smap, key, buf);
 }