Commit b8f475c0 by Serge Hallyn

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

parent 2b142295
...@@ -3036,15 +3036,15 @@ int lxc_assign_network(struct lxc_list *network, pid_t pid) ...@@ -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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment