]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
don't run lxc-user-nic for empty netns
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Thu, 12 Dec 2013 18:12:06 +0000 (12:12 -0600)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Thu, 12 Dec 2013 18:12:06 +0000 (12:12 -0600)
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
src/lxc/conf.c

index 0beb12bb26244b840f287ca1312f6f45891b169f..7228ebe477dcf6eacba663678a21cbcf3a0b3498 100644 (file)
@@ -3036,15 +3036,15 @@ 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 (!am_root) {
                        if (unpriv_assign_nic(netdev, pid))
                                return -1;
                        // TODO fill in netdev->ifindex and name
                        continue;
                }
-               /* empty network namespace, nothing to move */
-               if (!netdev->ifindex)
-                       continue;
 
                err = lxc_netdev_move_by_index(netdev->ifindex, pid);
                if (err) {