From: Daniel Lezcano Date: Wed, 24 Feb 2010 09:57:42 +0000 (+0100) Subject: fix empty network namespace X-Git-Tag: lxc-0.7.0~137 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=236087a6c8791f1ade2f80e8ed89712eee161d3f;p=thirdparty%2Flxc.git fix empty network namespace When there is an empty network namespace, we must not move the network device. Signed-off-by: Daniel Lezcano --- diff --git a/src/lxc/conf.c b/src/lxc/conf.c index eef67f107..cb8fc8766 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -1265,6 +1265,10 @@ int lxc_assign_network(struct lxc_list *network, pid_t pid) netdev = iterator->elem; + /* empty network namespace, nothing to move */ + if (!netdev->ifindex) + continue; + if (lxc_device_move(netdev->ifindex, pid)) { ERROR("failed to move '%s' to the container", netdev->link);