[CRIU] [PATCH 1/4] ns: Remove excess unshare CLONE_NEWNET

Andrei Vagin avagin at virtuozzo.com
Fri Feb 24 11:35:41 PST 2017


Applied, thanks!

On Fri, Feb 24, 2017 at 02:31:06PM +0300, Kirill Tkhai wrote:
> Child process is created to set NS_OTHER user_ns,
> before creation of a net_ns.
> 
> So, this CLONE_NEWNET is useless, and the created
> net_ns is lost right after we do unshare() in create_net_ns().
> 
> Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
> ---
>  criu/net.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/criu/net.c b/criu/net.c
> index fb4d9f84d..b420fbbdd 100644
> --- a/criu/net.c
> +++ b/criu/net.c
> @@ -1763,7 +1763,7 @@ int prepare_net_namespaces()
>  			continue;
>  
>  		if (root_user_ns && nsid->user_ns != root_user_ns) {
> -			pid = clone(create_net_ns, stack + 128, CLONE_NEWNET | SIGCHLD, nsid);
> +			pid = clone(create_net_ns, stack + 128, SIGCHLD, nsid);
>  			if (pid < 0) {
>  				pr_perror("Can't clone");
>  				goto err;
> 


More information about the CRIU mailing list