don't run lxc-user-nic for empty netns

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
This commit is contained in:
Serge Hallyn 2013-12-12 12:12:06 -06:00
parent 2b142295af
commit b8f475c017

View File

@ -3036,15 +3036,15 @@ int lxc_assign_network(struct lxc_list *network, pid_t pid)
netdev = iterator->elem; netdev = iterator->elem;
/* empty network namespace, nothing to move */
if (!netdev->ifindex)
continue;
if (!am_root) { if (!am_root) {
if (unpriv_assign_nic(netdev, pid)) if (unpriv_assign_nic(netdev, pid))
return -1; return -1;
// TODO fill in netdev->ifindex and name // TODO fill in netdev->ifindex and name
continue; continue;
} }
/* empty network namespace, nothing to move */
if (!netdev->ifindex)
continue;
err = lxc_netdev_move_by_index(netdev->ifindex, pid); err = lxc_netdev_move_by_index(netdev->ifindex, pid);
if (err) { if (err) {