From: Michael Tokarev Date: Fri, 20 Nov 2009 14:01:31 +0000 (+0100) Subject: allow link-less veth devices X-Git-Tag: lxc_0_6_4~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=734915aca15f4f5ab8a3897fe72214bf279f63aa;p=thirdparty%2Flxc.git 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: Michael Tokarev Signed-off-by: Daniel Lezcano --- diff --git a/src/lxc/conf.c b/src/lxc/conf.c index a930f85f1..357143630 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -845,8 +845,7 @@ static int instanciate_veth(struct lxc_netdev *netdev) } if (lxc_veth_create(veth1, veth2)) { - ERROR("failed to create %s-%s/%s", - veth1, veth2, netdev->link); + ERROR("failed to create %s-%s", veth1, veth2); goto out; } @@ -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'", veth1, netdev->link); goto out_delete;