[CRIU] [PATCH] tun/kerndat: Keep going with CONFIG_TUN=n

Andrei Vagin avagin at virtuozzo.com
Thu Jun 14 20:27:35 MSK 2018


Applied, thanks!

On Wed, Jun 13, 2018 at 11:57:13PM +0100, Dmitry Safonov wrote:
> check_tun_netns_cr() should return 0 on CONFIG_TUN=n kernels.
> That is, when we fail to open tun device.
> 
> Fixes: #496
> 
> Signed-off-by: Dmitry Safonov <dima at arista.com>
> ---
>  criu/tun.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/criu/tun.c b/criu/tun.c
> index 8274ccb8d71b..c1dabaf37d96 100644
> --- a/criu/tun.c
> +++ b/criu/tun.c
> @@ -74,17 +74,18 @@ int check_tun_cr(int no_tun_err)
>  
>  int check_tun_netns_cr(bool *result)
>  {
> -	bool val;
> +	bool val = false;
>  	int tun;
>  
>  	tun = open(TUN_DEV_GEN_PATH, O_RDONLY);
>  	if (tun < 0) {
>  		pr_perror("Unable to create tun");
> -		return -1;
> +		goto out;
>  	}
>  	check_has_netns_ioc(tun, &val, "tun");
>  	close(tun);
>  
> +out:
>  	if (result)
>  		*result = val;
>  
> -- 
> 2.13.6
> 
> _______________________________________________
> CRIU mailing list
> CRIU at openvz.org
> https://lists.openvz.org/mailman/listinfo/criu


More information about the CRIU mailing list