Skip to content

Commit

Permalink
Merge pull request #3589 from tych0/fix-nonet-cleanup
Browse files Browse the repository at this point in the history
network: fix LXC_NET_NONE cleanup
  • Loading branch information
stgraber committed Dec 2, 2020
2 parents 55f7e4d + 0421396 commit 065d331
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/lxc/network.c
Expand Up @@ -3605,6 +3605,13 @@ int lxc_restore_phys_nics_to_netns(struct lxc_handler *handler)
char ifname[IFNAMSIZ];
struct lxc_list *iterator;

/*
* If we weren't asked to clone a new network namespace, there's
* nothing to restore.
*/
if (!(handler->ns_clone_flags & CLONE_NEWNET))
return 0;

/* We need CAP_NET_ADMIN in the parent namespace in order to setns() to
* the parent network namespace. We won't have this capability if we are
* unprivileged.
Expand Down

0 comments on commit 065d331

Please sign in to comment.