Commit 734915ac by Michael Tokarev Committed by Daniel Lezcano

allow link-less veth devices

Before, a veth device pair required a link which was treated as a bridge device. Code crashed if there was no lxc.network.link specified. Fix that by allowing lxc.network.link to be unset Signed-off-by: 's avatarMichael Tokarev <mjt@tls.msk.ru> Signed-off-by: 's avatarDaniel Lezcano <dlezcano@fr.ibm.com>
parent 7418c9ce
...@@ -845,8 +845,7 @@ static int instanciate_veth(struct lxc_netdev *netdev) ...@@ -845,8 +845,7 @@ static int instanciate_veth(struct lxc_netdev *netdev)
} }
if (lxc_veth_create(veth1, veth2)) { if (lxc_veth_create(veth1, veth2)) {
ERROR("failed to create %s-%s/%s", ERROR("failed to create %s-%s", veth1, veth2);
veth1, veth2, netdev->link);
goto out; goto out;
} }
...@@ -864,7 +863,7 @@ static int instanciate_veth(struct lxc_netdev *netdev) ...@@ -864,7 +863,7 @@ static int instanciate_veth(struct lxc_netdev *netdev)
} }
} }
if (lxc_bridge_attach(netdev->link, veth1)) { if (netdev->link && lxc_bridge_attach(netdev->link, veth1)) {
ERROR("failed to attach '%s' to the bridge '%s'", ERROR("failed to attach '%s' to the bridge '%s'",
veth1, netdev->link); veth1, netdev->link);
goto out_delete; goto out_delete;
......
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