confile: lxc.net.ipv6 --> lxc.net.ipv6.address

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
This commit is contained in:
Christian Brauner 2017-07-02 11:54:27 +02:00
parent 9ff60df25b
commit 2e44ae28dc
No known key found for this signature in database
GPG Key ID: 7B3C391EFEA93624
12 changed files with 35 additions and 35 deletions

View File

@ -84,8 +84,8 @@ LXC is configured via a simple set of keys. For example,
LXC namespaces configuration keys by using single dots. This means complex LXC namespaces configuration keys by using single dots. This means complex
configuration keys such as `lxc.net.0` expose various subkeys such as configuration keys such as `lxc.net.0` expose various subkeys such as
`lxc.net.0.type`, `lxc.net.0.link`, `lxc.net.0.ipv6`, and others for even `lxc.net.0.type`, `lxc.net.0.link`, `lxc.net.0.ipv6.address`, and others for
more fine-grained configuration. even more fine-grained configuration.
LXC is used as the default runtime for [LXD](https://github.com/lxc/lxd), LXC is used as the default runtime for [LXD](https://github.com/lxc/lxd),
a container hypervisor exposing a well-designed and stable REST-api on top of a container hypervisor exposing a well-designed and stable REST-api on top of

View File

@ -6,18 +6,18 @@ lxc.net.0.flags = up
lxc.net.0.link = br0 lxc.net.0.link = br0
lxc.net.0.hwaddr = 4a:49:43:49:79:bf lxc.net.0.hwaddr = 4a:49:43:49:79:bf
lxc.net.0.ipv4.address = 10.2.3.5/24 lxc.net.0.ipv4.address = 10.2.3.5/24
lxc.net.0.ipv6 = 2003:db8:1:0:214:1234:fe0b:3597 lxc.net.0.ipv6.address = 2003:db8:1:0:214:1234:fe0b:3597
lxc.net.0.type = macvlan lxc.net.0.type = macvlan
lxc.net.0.flags = up lxc.net.0.flags = up
lxc.net.0.link = eth0 lxc.net.0.link = eth0
lxc.net.0.hwaddr = 4a:49:43:49:79:bd lxc.net.0.hwaddr = 4a:49:43:49:79:bd
lxc.net.0.ipv4.address = 10.2.3.4/24 lxc.net.0.ipv4.address = 10.2.3.4/24
lxc.net.0.ipv6 = 2003:db8:1:0:214:1234:fe0b:3596 lxc.net.0.ipv6.address = 2003:db8:1:0:214:1234:fe0b:3596
lxc.net.0.type = phys lxc.net.0.type = phys
lxc.net.0.flags = up lxc.net.0.flags = up
lxc.net.0.link = dummy0 lxc.net.0.link = dummy0
lxc.net.0.hwaddr = 4a:49:43:49:79:ff lxc.net.0.hwaddr = 4a:49:43:49:79:ff
lxc.net.0.ipv4.address = 10.2.3.6/24 lxc.net.0.ipv4.address = 10.2.3.6/24
lxc.net.0.ipv6 = 2003:db8:1:0:214:1234:fe0b:3297 lxc.net.0.ipv6.address = 2003:db8:1:0:214:1234:fe0b:3297

View File

@ -5,4 +5,4 @@ lxc.net.0.flags = up
lxc.net.0.link = eth0 lxc.net.0.link = eth0
lxc.net.0.hwaddr = 4a:49:43:49:79:bd lxc.net.0.hwaddr = 4a:49:43:49:79:bd
lxc.net.0.ipv4.address = 10.2.3.4/24 lxc.net.0.ipv4.address = 10.2.3.4/24
lxc.net.0.ipv6 = 2003:db8:1:0:214:1234:fe0b:3596 lxc.net.0.ipv6.address = 2003:db8:1:0:214:1234:fe0b:3596

View File

@ -6,4 +6,4 @@ lxc.net.0.flags = up
lxc.net.0.link = eth0 lxc.net.0.link = eth0
lxc.net.0.hwaddr = 4a:49:43:49:79:ff lxc.net.0.hwaddr = 4a:49:43:49:79:ff
lxc.net.0.ipv4.address = 10.2.3.6/24 lxc.net.0.ipv4.address = 10.2.3.6/24
lxc.net.0.ipv6 = 2003:db8:1:0:214:1234:fe0b:3297 lxc.net.0.ipv6.address = 2003:db8:1:0:214:1234:fe0b:3297

View File

@ -6,4 +6,4 @@ lxc.net.0.flags = up
lxc.net.0.link = br0 lxc.net.0.link = br0
lxc.net.0.hwaddr = 4a:49:43:49:79:bf lxc.net.0.hwaddr = 4a:49:43:49:79:bf
lxc.net.0.ipv4.address = 10.2.3.5/24 lxc.net.0.ipv4.address = 10.2.3.5/24
lxc.net.0.ipv6 = 2003:db8:1:0:214:1234:fe0b:3597 lxc.net.0.ipv6.address = 2003:db8:1:0:214:1234:fe0b:3597

View File

@ -6,4 +6,4 @@ lxc.net.0.flags = up
lxc.net.0.link = eth0 lxc.net.0.link = eth0
lxc.net.0.hwaddr = 4a:49:43:49:79:bd lxc.net.0.hwaddr = 4a:49:43:49:79:bd
lxc.net.0.ipv4.address = 10.2.3.4/24 lxc.net.0.ipv4.address = 10.2.3.4/24
lxc.net.0.ipv6 = 2003:db8:1:0:214:1234:fe0b:3596 lxc.net.0.ipv6.address = 2003:db8:1:0:214:1234:fe0b:3596

View File

@ -32,5 +32,5 @@ lxc.net.0.ipv4.address = 1.2.3.5/24
# specify the ipv6 address of the container. Several lines are allowed and # specify the ipv6 address of the container. Several lines are allowed and
# will mean several addresses will be assigned to the interface # will mean several addresses will be assigned to the interface
lxc.net.0.ipv6 = 2003:db8:1:0:214:1234:fe0b:3596 lxc.net.0.ipv6.address = 2003:db8:1:0:214:1234:fe0b:3596

View File

@ -102,7 +102,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
LXC namespaces configuration keys by using single dots. This means complex LXC namespaces configuration keys by using single dots. This means complex
configuration keys such as <option>lxc.net.0</option> expose various configuration keys such as <option>lxc.net.0</option> expose various
subkeys such as <option>lxc.net.0.type</option>, subkeys such as <option>lxc.net.0.type</option>,
<option>lxc.net.0.link</option>, <option>lxc.net.0.ipv6</option>, and <option>lxc.net.0.link</option>, <option>lxc.net.0.ipv6.address</option>, and
others for even more fine-grained configuration. others for even more fine-grained configuration.
</para> </para>
@ -557,7 +557,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
<varlistentry> <varlistentry>
<term> <term>
<option>lxc.net.[i].ipv6</option> <option>lxc.net.[i].ipv6.address</option>
</term> </term>
<listitem> <listitem>
<para> <para>
@ -1925,7 +1925,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
lxc.net.0.name = eth0 lxc.net.0.name = eth0
lxc.net.0.hwaddr = 4a:49:43:49:79:bf lxc.net.0.hwaddr = 4a:49:43:49:79:bf
lxc.net.0.ipv4.address = 10.2.3.5/24 10.2.3.255 lxc.net.0.ipv4.address = 10.2.3.5/24 10.2.3.255
lxc.net.0.ipv6 = 2003:db8:1:0:214:1234:fe0b:3597 lxc.net.0.ipv6.address = 2003:db8:1:0:214:1234:fe0b:3597
</programlisting> </programlisting>
</refsect2> </refsect2>
@ -1967,21 +1967,21 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
lxc.net.0.link = br0 lxc.net.0.link = br0
lxc.net.0.hwaddr = 4a:49:43:49:79:bf lxc.net.0.hwaddr = 4a:49:43:49:79:bf
lxc.net.0.ipv4.address = 10.2.3.5/24 10.2.3.255 lxc.net.0.ipv4.address = 10.2.3.5/24 10.2.3.255
lxc.net.0.ipv6 = 2003:db8:1:0:214:1234:fe0b:3597 lxc.net.0.ipv6.address = 2003:db8:1:0:214:1234:fe0b:3597
lxc.net.0.ipv6 = 2003:db8:1:0:214:5432:feab:3588 lxc.net.0.ipv6.address = 2003:db8:1:0:214:5432:feab:3588
lxc.net.1.type = macvlan lxc.net.1.type = macvlan
lxc.net.1.flags = up lxc.net.1.flags = up
lxc.net.1.link = eth0 lxc.net.1.link = eth0
lxc.net.1.hwaddr = 4a:49:43:49:79:bd lxc.net.1.hwaddr = 4a:49:43:49:79:bd
lxc.net.1.ipv4.address = 10.2.3.4/24 lxc.net.1.ipv4.address = 10.2.3.4/24
lxc.net.1.ipv4.address = 192.168.10.125/24 lxc.net.1.ipv4.address = 192.168.10.125/24
lxc.net.1.ipv6 = 2003:db8:1:0:214:1234:fe0b:3596 lxc.net.1.ipv6.address = 2003:db8:1:0:214:1234:fe0b:3596
lxc.net.2.type = phys lxc.net.2.type = phys
lxc.net.2.flags = up lxc.net.2.flags = up
lxc.net.2.link = dummy0 lxc.net.2.link = dummy0
lxc.net.2.hwaddr = 4a:49:43:49:79:ff lxc.net.2.hwaddr = 4a:49:43:49:79:ff
lxc.net.2.ipv4.address = 10.2.3.6/24 lxc.net.2.ipv4.address = 10.2.3.6/24
lxc.net.2.ipv6 = 2003:db8:1:0:214:1234:fe0b:3297 lxc.net.2.ipv6.address = 2003:db8:1:0:214:1234:fe0b:3297
lxc.cgroup.cpuset.cpus = 0,1 lxc.cgroup.cpuset.cpus = 0,1
lxc.cgroup.cpu.shares = 1234 lxc.cgroup.cpu.shares = 1234
lxc.cgroup.devices.deny = a lxc.cgroup.devices.deny = a

View File

@ -107,7 +107,7 @@ lxc_config_define(net_ipv4_address);
lxc_config_define(net_ipv4_gateway); lxc_config_define(net_ipv4_gateway);
lxc_config_define(net_script_up); lxc_config_define(net_script_up);
lxc_config_define(net_script_down); lxc_config_define(net_script_down);
lxc_config_define(net_ipv6); lxc_config_define(net_ipv6_address);
lxc_config_define(net_ipv6_gateway); lxc_config_define(net_ipv6_gateway);
lxc_config_define(net_nic); lxc_config_define(net_nic);
lxc_config_define(net); lxc_config_define(net);
@ -231,7 +231,7 @@ static struct lxc_config_t config[] = {
{ "lxc.net.ipv4.gateway", set_config_net_ipv4_gateway, get_config_net_ipv4_gateway, clr_config_net_ipv4_gateway, }, { "lxc.net.ipv4.gateway", set_config_net_ipv4_gateway, get_config_net_ipv4_gateway, clr_config_net_ipv4_gateway, },
{ "lxc.net.ipv4.address", set_config_net_ipv4_address, get_config_net_ipv4_address, clr_config_net_ipv4_address, }, { "lxc.net.ipv4.address", set_config_net_ipv4_address, get_config_net_ipv4_address, clr_config_net_ipv4_address, },
{ "lxc.net.ipv6.gateway", set_config_net_ipv6_gateway, get_config_net_ipv6_gateway, clr_config_net_ipv6_gateway, }, { "lxc.net.ipv6.gateway", set_config_net_ipv6_gateway, get_config_net_ipv6_gateway, clr_config_net_ipv6_gateway, },
{ "lxc.net.ipv6", set_config_net_ipv6, get_config_net_ipv6, clr_config_net_ipv6, }, { "lxc.net.ipv6.address", set_config_net_ipv6_address, get_config_net_ipv6_address, clr_config_net_ipv6_address, },
{ "lxc.net.", set_config_net_nic, get_config_net_nic, clr_config_net_nic, }, { "lxc.net.", set_config_net_nic, get_config_net_nic, clr_config_net_nic, },
{ "lxc.net", set_config_net, get_config_net, clr_config_net, }, { "lxc.net", set_config_net, get_config_net, clr_config_net, },
{ "lxc.cap.drop", set_config_cap_drop, get_config_cap_drop, clr_config_cap_drop, }, { "lxc.cap.drop", set_config_cap_drop, get_config_cap_drop, clr_config_cap_drop, },
@ -519,7 +519,7 @@ extern int lxc_list_nicconfigs(struct lxc_conf *c, const char *key, char *retv,
strprint(retv, inlen, "name\n"); strprint(retv, inlen, "name\n");
strprint(retv, inlen, "hwaddr\n"); strprint(retv, inlen, "hwaddr\n");
strprint(retv, inlen, "mtu\n"); strprint(retv, inlen, "mtu\n");
strprint(retv, inlen, "ipv6\n"); strprint(retv, inlen, "ipv6.address\n");
strprint(retv, inlen, "ipv6.gateway\n"); strprint(retv, inlen, "ipv6.gateway\n");
strprint(retv, inlen, "ipv4.address\n"); strprint(retv, inlen, "ipv4.address\n");
strprint(retv, inlen, "ipv4.gateway\n"); strprint(retv, inlen, "ipv4.gateway\n");
@ -893,7 +893,7 @@ static int set_config_net_ipv4_gateway(const char *key, const char *value,
return 0; return 0;
} }
static int set_config_net_ipv6(const char *key, const char *value, static int set_config_net_ipv6_address(const char *key, const char *value,
struct lxc_conf *lxc_conf, void *data) struct lxc_conf *lxc_conf, void *data)
{ {
struct lxc_netdev *netdev; struct lxc_netdev *netdev;
@ -902,7 +902,7 @@ static int set_config_net_ipv6(const char *key, const char *value,
char *slash, *valdup, *netmask; char *slash, *valdup, *netmask;
if (lxc_config_value_empty(value)) if (lxc_config_value_empty(value))
return clr_config_net_ipv6(key, lxc_conf, data); return clr_config_net_ipv6_address(key, lxc_conf, data);
if (!data) if (!data)
return -1; return -1;
@ -4059,8 +4059,8 @@ static int clr_config_net_ipv6_gateway(const char *key,
return 0; return 0;
} }
static int clr_config_net_ipv6(const char *key, struct lxc_conf *lxc_conf, static int clr_config_net_ipv6_address(const char *key,
void *data) struct lxc_conf *lxc_conf, void *data)
{ {
struct lxc_netdev *netdev; struct lxc_netdev *netdev;
struct lxc_list *cur, *next; struct lxc_list *cur, *next;
@ -4479,7 +4479,7 @@ static int get_config_net_ipv6_gateway(const char *key, char *retv, int inlen,
return fulllen; return fulllen;
} }
static int get_config_net_ipv6(const char *key, char *retv, int inlen, static int get_config_net_ipv6_address(const char *key, char *retv, int inlen,
struct lxc_conf *c, void *data) struct lxc_conf *c, void *data)
{ {
int len, fulllen = 0; int len, fulllen = 0;

View File

@ -105,15 +105,15 @@ static int set_and_clear_complete_netdev(struct lxc_container *c)
return -1; return -1;
} }
if (!c->set_config_item(c, "lxc.net.1.ipv6", if (!c->set_config_item(c, "lxc.net.1.ipv6.address",
"2003:db8:1:0:214:1234:fe0b:3596/64")) { "2003:db8:1:0:214:1234:fe0b:3596/64")) {
lxc_error("%s\n", "lxc.net.1.ipv6"); lxc_error("%s\n", "lxc.net.1.ipv6.address");
return -1; return -1;
} }
if (!c->set_config_item(c, "lxc.net.1.ipv6_gateway", if (!c->set_config_item(c, "lxc.net.1.ipv6.gateway",
"2003:db8:1:0::1")) { "2003:db8:1:0::1")) {
lxc_error("%s\n", "lxc.net.1.ipv6"); lxc_error("%s\n", "lxc.net.1.ipv6.gateway");
return -1; return -1;
} }
@ -992,9 +992,9 @@ int main(int argc, char *argv[])
} }
if (set_get_compare_clear_save_load( if (set_get_compare_clear_save_load(
c, "lxc.net.0.ipv6", "2003:db8:1:0:214:1234:fe0b:3596/64", c, "lxc.net.0.ipv6.address", "2003:db8:1:0:214:1234:fe0b:3596/64",
tmpf, true)) { tmpf, true)) {
lxc_error("%s\n", "lxc.net.0.ipv6"); lxc_error("%s\n", "lxc.net.0.ipv6.address");
goto non_test_error; goto non_test_error;
} }

View File

@ -303,7 +303,7 @@ EOF
fi fi
if [ ! -z ${ipv6} ]; then if [ ! -z ${ipv6} ]; then
cat <<EOF >> $config_path/config cat <<EOF >> $config_path/config
lxc.net.0.ipv6 = $ipv6 lxc.net.0.ipv6.address = $ipv6
EOF EOF
fi fi
if [ ! -z ${gw6} ]; then if [ ! -z ${gw6} ]; then

View File

@ -256,7 +256,7 @@ EOF
fi fi
if [ ! -z ${ipv6} ]; then if [ ! -z ${ipv6} ]; then
cat <<EOF >> $config_path/config cat <<EOF >> $config_path/config
lxc.net.0.ipv6 = $ipv6 lxc.net.0.ipv6.address = $ipv6
EOF EOF
fi fi
if [ ! -z ${gw6} ]; then if [ ! -z ${gw6} ]; then