]>
git.ipfire.org Git - thirdparty/lxc.git/commit
network: use two passes through networks
Consider the following network layout:
lxc.net.0.type = phys
lxc.net.0.link = eth2
lxc.net.0.name = eth%d
lxc.net.1.type = phys
lxc.net.1.link = eth1
lxc.net.1.name = eth0
If we simply follow this order and create the first network first the kernel
will allocate eth0 for the first network but the second network requests
that eth1 be renamed to eth0 in the container's network namespace which
would lead to a clash.
Note, we don't handle cases like:
lxc.net.0.type = phys
lxc.net.0.link = eth2
lxc.net.0.name = eth0
lxc.net.1.type = phys
lxc.net.1.link = eth1
lxc.net.1.name = eth0
That'll brutally fail of course but there's nothing we can do about it. But
this can happen when e.g. a has the following LXD configuration:
devices:
eth2:
name: eth0
nictype: physical
parent: eth2
type: nic
eth3:
name: eth0
nictype: physical
parent: eth3
type: nic
in the container's config and the default profile has:
devices:
eth0:
name: eth0
network: lxdbr0
type: nic
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>