]> git.proxmox.com Git - mirror_lxc.git/commitdiff
fix empty network namespace
authorDaniel Lezcano <daniel.lezcano@free.fr>
Wed, 24 Feb 2010 09:57:42 +0000 (10:57 +0100)
committerDaniel Lezcano <dlezcano@fr.ibm.com>
Wed, 24 Feb 2010 09:57:42 +0000 (10:57 +0100)
When there is an empty network namespace, we must not move the
network device.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
src/lxc/conf.c

index eef67f1071c26157c4dc06dbd26f4015333b8d9f..cb8fc8766e429fb2507221cad8239871e817ed7a 100644 (file)
@@ -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);