mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-07 09:26:26 +00:00
Fix presentation of IPv6 addresses and gateway
Signed-off-by: Andre Nathan <andre@digirati.com.br> Acked-by: Stéphane Graber <stgraber@ubuntu.com>
This commit is contained in:
parent
a3289423eb
commit
6afb165dd1
@ -2216,15 +2216,15 @@ static int lxc_get_item_nic(struct lxc_conf *c, char *retv, int inlen,
|
|||||||
if (netdev->ipv6_gateway_auto) {
|
if (netdev->ipv6_gateway_auto) {
|
||||||
strprint(retv, inlen, "auto");
|
strprint(retv, inlen, "auto");
|
||||||
} else if (netdev->ipv6_gateway) {
|
} else if (netdev->ipv6_gateway) {
|
||||||
char buf[INET_ADDRSTRLEN];
|
char buf[INET6_ADDRSTRLEN];
|
||||||
inet_ntop(AF_INET, netdev->ipv6_gateway, buf, sizeof(buf));
|
inet_ntop(AF_INET6, netdev->ipv6_gateway, buf, sizeof(buf));
|
||||||
strprint(retv, inlen, "%s", buf);
|
strprint(retv, inlen, "%s", buf);
|
||||||
}
|
}
|
||||||
} else if (strcmp(p1, "ipv6") == 0) {
|
} else if (strcmp(p1, "ipv6") == 0) {
|
||||||
struct lxc_list *it2;
|
struct lxc_list *it2;
|
||||||
lxc_list_for_each(it2, &netdev->ipv6) {
|
lxc_list_for_each(it2, &netdev->ipv6) {
|
||||||
struct lxc_inetdev *i = it2->elem;
|
struct lxc_inet6dev *i = it2->elem;
|
||||||
char buf[INET_ADDRSTRLEN];
|
char buf[INET6_ADDRSTRLEN];
|
||||||
inet_ntop(AF_INET6, &i->addr, buf, sizeof(buf));
|
inet_ntop(AF_INET6, &i->addr, buf, sizeof(buf));
|
||||||
strprint(retv, inlen, "%s\n", buf);
|
strprint(retv, inlen, "%s\n", buf);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user