From: Andre Nathan Date: Wed, 24 Sep 2014 13:08:50 +0000 (-0300) Subject: Fix presentation of IPv6 addresses and gateway X-Git-Tag: lxc-1.1.0.alpha2~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6afb165dd1ca89a364f0f503a0a08afc8abc2600;p=thirdparty%2Flxc.git Fix presentation of IPv6 addresses and gateway Signed-off-by: Andre Nathan Acked-by: Stéphane Graber --- diff --git a/src/lxc/confile.c b/src/lxc/confile.c index 0e932c674..9af2aa4f4 100644 --- a/src/lxc/confile.c +++ b/src/lxc/confile.c @@ -2216,15 +2216,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); }