Commit 89addaa7 by Robert Vogelgesang Committed by Stéphane Graber

Don't forget network prefix information

Include the IPv4/IPv6 prefix if it's set. Signed-off-by: 's avatarRobert Vogelgesang <vogel@users.sourceforge.net> Acked-by: 's avatarStéphane Graber <stgraber@ubuntu.com>
parent c868b261
......@@ -2267,7 +2267,11 @@ void write_config(FILE *fout, struct lxc_conf *c)
struct lxc_inetdev *i = it2->elem;
char buf[INET_ADDRSTRLEN];
inet_ntop(AF_INET, &i->addr, buf, sizeof(buf));
fprintf(fout, "lxc.network.ipv4 = %s\n", buf);
if (i->prefix)
fprintf(fout, "lxc.network.ipv4 = %s/%d\n",
buf, i->prefix);
else
fprintf(fout, "lxc.network.ipv4 = %s\n", buf);
}
if (n->ipv6_gateway_auto)
fprintf(fout, "lxc.network.ipv6.gateway = auto\n");
......@@ -2280,7 +2284,11 @@ void write_config(FILE *fout, struct lxc_conf *c)
struct lxc_inet6dev *i = it2->elem;
char buf[INET6_ADDRSTRLEN];
inet_ntop(AF_INET6, &i->addr, buf, sizeof(buf));
fprintf(fout, "lxc.network.ipv6 = %s\n", buf);
if (i->prefix)
fprintf(fout, "lxc.network.ipv6 = %s/%d\n",
buf, i->prefix);
else
fprintf(fout, "lxc.network.ipv6 = %s\n", buf);
}
}
lxc_list_for_each(it, &c->caps)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment