From 236087a6c8791f1ade2f80e8ed89712eee161d3f Mon Sep 17 00:00:00 2001 From: Daniel Lezcano Date: Wed, 24 Feb 2010 10:57:42 +0100 Subject: [PATCH] fix empty network namespace When there is an empty network namespace, we must not move the network device. Signed-off-by: Daniel Lezcano --- src/lxc/conf.c | 4 ++++ 1 file changed, 4 insertions(+) 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); -- 2.47.2