Skip to content

Commit

Permalink
Merge pull request #3069 from brauner/2019-07-01/network_creation
Browse files Browse the repository at this point in the history
start: unify network creation
  • Loading branch information
stgraber committed Jul 2, 2019
2 parents c83ad42 + 1871e64 commit 4f71ecb
Show file tree
Hide file tree
Showing 4 changed files with 149 additions and 134 deletions.
21 changes: 12 additions & 9 deletions src/lxc/conf.c
Expand Up @@ -3563,16 +3563,19 @@ int lxc_setup(struct lxc_handler *handler)
if (ret < 0)
return -1;

ret = lxc_setup_network_in_child_namespaces(lxc_conf, &lxc_conf->network);
if (ret < 0) {
ERROR("Failed to setup network");
return -1;
}
if (handler->ns_clone_flags & CLONE_NEWNET) {
ret = lxc_setup_network_in_child_namespaces(lxc_conf,
&lxc_conf->network);
if (ret < 0) {
ERROR("Failed to setup network");
return -1;
}

ret = lxc_network_send_name_and_ifindex_to_parent(handler);
if (ret < 0) {
ERROR("Failed to send network device names and ifindices to parent");
return -1;
ret = lxc_network_send_name_and_ifindex_to_parent(handler);
if (ret < 0) {
ERROR("Failed to send network device names and ifindices to parent");
return -1;
}
}

if (lxc_conf->autodev > 0) {
Expand Down

0 comments on commit 4f71ecb

Please sign in to comment.