]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
Fix presentation of IPv6 addresses and gateway
authorAndre Nathan <andre@digirati.com.br>
Wed, 24 Sep 2014 13:08:50 +0000 (10:08 -0300)
committerStéphane Graber <stgraber@ubuntu.com>
Wed, 24 Sep 2014 18:48:51 +0000 (14:48 -0400)
Signed-off-by: Andre Nathan <andre@digirati.com.br>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
src/lxc/confile.c

index dcd95189a85d886f6fc2028748fed371646fb1f6..bd6196a046a47a27904dae923f46fbf21c667ff9 100644 (file)
@@ -2101,15 +2101,15 @@ static int lxc_get_item_nic(struct lxc_conf *c, char *retv, int inlen,
                if (netdev->ipv6_gateway_auto) {
                        strprint(retv, inlen, "auto");
                } else if (netdev->ipv6_gateway) {
-                       char buf[INET_ADDRSTRLEN];
-                       inet_ntop(AF_INET, netdev->ipv6_gateway, buf, sizeof(buf));
+                       char buf[INET6_ADDRSTRLEN];
+                       inet_ntop(AF_INET6, netdev->ipv6_gateway, buf, sizeof(buf));
                        strprint(retv, inlen, "%s", buf);
                }
        } else if (strcmp(p1, "ipv6") == 0) {
                struct lxc_list *it2;
                lxc_list_for_each(it2, &netdev->ipv6) {
-                       struct lxc_inetdev *i = it2->elem;
-                       char buf[INET_ADDRSTRLEN];
+                       struct lxc_inet6dev *i = it2->elem;
+                       char buf[INET6_ADDRSTRLEN];
                        inet_ntop(AF_INET6, &i->addr, buf, sizeof(buf));
                        strprint(retv, inlen, "%s\n", buf);
                }