[CRIU] [PATCH 2/2] net: Don't fail on missing icmp entries

Cyrill Gorcunov gorcunov at gmail.com
Tue May 12 01:55:29 PDT 2015


On Tue, May 12, 2015 at 11:47:47AM +0300, Pavel Emelyanov wrote:
> 
> I mean like this
> 
> @@ -100,11 +107,14 @@ static int ipv4_conf_op(char *tgt, int *conf, int op, NetnsEntry **netns)
>  			continue;
>  		}
>  
> +		if (op == CTL_WRITE && conf[i] == DEVCONFS_UNUSED)
> +			continue;
> +
>  		snprintf(path[i], MAX_CONF_OPT_PATH, "%s/%s/%s", NET_CONF_PATH, tgt, devconfs[i]);
>  		req[ri].name = path[i];
>  		req[ri].arg = &conf[i];
>  		req[ri].type = CTL_32;
> -		req[ri].flags = 0;
> +		req[ri].flags = flags;
> +		conf[i] = DEVCONFS_UNUSED;
>  		req[ri].status = 0;
>  		ri++;
>  	}
> 
> and no post-loop.

This won't work, conf[i] here comes for write operation as well,
so you have to add another if (op == READ) which makes code
even more uglier i think. Moreover this rewrites caller variable
without testing if its optional. That said, I don;t like such
approach, but if you prefer sure I can add if (op == read) here.

	Cyrill


More information about the CRIU mailing list