diff --git a/criu/net.c b/criu/net.c index f41866b56..4ae9e9c36 100644 --- a/criu/net.c +++ b/criu/net.c @@ -2325,14 +2325,11 @@ static int create_net_ns(void *arg) exit(ret); } -int prepare_net_namespaces() +static int __prepare_net_namespaces(void *unused) { struct ns_id *nsid; int ret = -1; - if (!(root_ns_mask & CLONE_NEWNET)) - return 0; - for (nsid = ns_ids; nsid != NULL; nsid = nsid->next) { if (nsid->nd != &net_ns_desc) continue; @@ -2389,6 +2386,15 @@ err: return ret; } + +int prepare_net_namespaces(void) +{ + if (!(root_ns_mask & CLONE_NEWNET)) + return 0; + + return call_in_child_process(__prepare_net_namespaces, NULL); +} + static int do_restore_task_net_ns(struct ns_id *nsid, struct pstree_item *current) { int fd; diff --git a/test/zdtm/static/tun.desc b/test/zdtm/static/tun.desc index 8c7cfe860..eac32c2d0 100644 --- a/test/zdtm/static/tun.desc +++ b/test/zdtm/static/tun.desc @@ -1 +1 @@ -{'flavor': 'ns uns', 'flags': 'suid', 'feature': 'tun'} +{'flavor': 'ns uns', 'flags': 'suid noauto', 'feature': 'tun'}