]> git.proxmox.com Git - mirror_lxc.git/commitdiff
Include network prefix when ipv4/ipv6 keys are queried
authorSergio Jimenez <tripledes@gmail.com>
Wed, 24 Sep 2014 21:55:14 +0000 (23:55 +0200)
committerStéphane Graber <stgraber@ubuntu.com>
Wed, 24 Sep 2014 22:51:27 +0000 (18:51 -0400)
Signed-off-by: Sergio Jimenez <tripledes@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
src/lxc/confile.c

index 9af2aa4f436c2a09667e9b4433585a1ac00150fc..0722a37ead0b930e365649f946381bd62001f0a3 100644 (file)
@@ -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;