Skip to content

Commit

Permalink
Include network prefix when ipv4/ipv6 keys are queried
Browse files Browse the repository at this point in the history
Signed-off-by: Sergio Jimenez <tripledes@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
  • Loading branch information
tripledes authored and stgraber committed Sep 24, 2014
1 parent 1fd3722 commit 28417b5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lxc/confile.c
Expand Up @@ -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) {
Expand All @@ -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;
Expand Down

0 comments on commit 28417b5

Please sign in to comment.