Commit 69783413 by Sergio Jimenez Committed by Stéphane Graber

Include network prefix when ipv4/ipv6 keys are queried

parent dbd702fb
...@@ -2095,7 +2095,7 @@ static int lxc_get_item_nic(struct lxc_conf *c, char *retv, int inlen, ...@@ -2095,7 +2095,7 @@ static int lxc_get_item_nic(struct lxc_conf *c, char *retv, int inlen,
struct lxc_inetdev *i = it2->elem; struct lxc_inetdev *i = it2->elem;
char buf[INET_ADDRSTRLEN]; char buf[INET_ADDRSTRLEN];
inet_ntop(AF_INET, &i->addr, buf, sizeof(buf)); inet_ntop(AF_INET, &i->addr, buf, sizeof(buf));
strprint(retv, inlen, "%s\n", buf); strprint(retv, inlen, "%s/%d\n", buf, i->prefix);
} }
} else if (strcmp(p1, "ipv6_gateway") == 0) { } else if (strcmp(p1, "ipv6_gateway") == 0) {
if (netdev->ipv6_gateway_auto) { if (netdev->ipv6_gateway_auto) {
...@@ -2111,7 +2111,7 @@ static int lxc_get_item_nic(struct lxc_conf *c, char *retv, int inlen, ...@@ -2111,7 +2111,7 @@ static int lxc_get_item_nic(struct lxc_conf *c, char *retv, int inlen,
struct lxc_inet6dev *i = it2->elem; struct lxc_inet6dev *i = it2->elem;
char buf[INET6_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/%d\n", buf, i->prefix);
} }
} }
return fulllen; return fulllen;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment