]> git.ipfire.org Git - thirdparty/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:52:49 +0000 (18:52 -0400)
Signed-off-by: Sergio Jimenez <tripledes@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
src/lxc/confile.c

index bd6196a046a47a27904dae923f46fbf21c667ff9..6858c5cf1b7cc21c9e1688751e6e755a33e59373 100644 (file)
@@ -2095,7 +2095,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) {
@@ -2111,7 +2111,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;