]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
allow link-less veth devices
authorMichael Tokarev <mjt@tls.msk.ru>
Fri, 20 Nov 2009 14:01:31 +0000 (15:01 +0100)
committerDaniel Lezcano <dlezcano@fr.ibm.com>
Fri, 20 Nov 2009 14:01:31 +0000 (15:01 +0100)
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 <mjt@tls.msk.ru>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
src/lxc/conf.c

index a930f85f14f4ac76f5827dbe098053c1c3754473..3571436309b5fc7fdc903b690f5ffd7b2da6a242 100644 (file)
@@ -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;