]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
confile: Fix invalid lxc.network.ipv6 address
authorStéphane Graber <stgraber@ubuntu.com>
Fri, 6 Dec 2013 20:28:55 +0000 (15:28 -0500)
committerStéphane Graber <stgraber@ubuntu.com>
Fri, 6 Dec 2013 20:28:55 +0000 (15:28 -0500)
The writer code was using AF_INET instead of AF_INET6 when converting
the address to ascii.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
src/lxc/confile.c

index 5f25e08ce5b1d1101396bebb262c792bc1e2235c..732a81ab13e2637a6e170f4a6e1ccfef3e021d7f 100644 (file)
@@ -2096,7 +2096,7 @@ void write_config(FILE *fout, struct lxc_conf *c)
                lxc_list_for_each(it2, &n->ipv6) {
                        struct lxc_inet6dev *i = it2->elem;
                        char buf[INET6_ADDRSTRLEN];
-                       inet_ntop(AF_INET, &i->addr, buf, sizeof(buf));
+                       inet_ntop(AF_INET6, &i->addr, buf, sizeof(buf));
                        fprintf(fout, "lxc.network.ipv6 = %s\n", buf);
                }
        }