From 28417b5a874f85c118158a9874b5e0ba73bc3a03 Mon Sep 17 00:00:00 2001 From: Sergio Jimenez Date: Wed, 24 Sep 2014 23:55:14 +0200 Subject: [PATCH] Include network prefix when ipv4/ipv6 keys are queried MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Sergio Jimenez Acked-by: Stéphane Graber --- src/lxc/confile.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lxc/confile.c b/src/lxc/confile.c index 9af2aa4f43..0722a37ead 100644 --- a/src/lxc/confile.c +++ b/src/lxc/confile.c @@ -2210,7 +2210,7 @@ static int lxc_get_item_nic(struct lxc_conf *c, char *retv, int inlen, struct lxc_inetdev *i = it2->elem; char buf[INET_ADDRSTRLEN]; 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) { if (netdev->ipv6_gateway_auto) { @@ -2226,7 +2226,7 @@ static int lxc_get_item_nic(struct lxc_conf *c, char *retv, int inlen, 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); + strprint(retv, inlen, "%s/%d\n", buf, i->prefix); } } return fulllen;