[lxc-devel] [PATCH 1/4] allow link-less veth devices
Michael Tokarev
mjt at tls.msk.ru
Thu Nov 19 14:49:03 UTC 2009
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 at tls.msk.ru>
---
src/lxc/conf.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/lxc/conf.c b/src/lxc/conf.c
index a930f85..3571436 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;
--
1.6.3.3
More information about the lxc-devel
mailing list