Skip to content

Commit

Permalink
don't run lxc-user-nic for empty netns
Browse files Browse the repository at this point in the history
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
  • Loading branch information
hallyn committed Dec 12, 2013
1 parent 2b14229 commit b8f475c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lxc/conf.c
Expand Up @@ -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) {
Expand Down

0 comments on commit b8f475c

Please sign in to comment.