[CRIU] [PATCH v2 6/8] workaround "mc_forwarding" is not writable

Pavel Emelyanov xemul at parallels.com
Thu Sep 25 22:55:02 PDT 2014


On 09/25/2014 12:00 PM, Pavel Tikhomirov wrote:

Some comment would be nice.

> Signed-off-by: Pavel Tikhomirov <ptikhomirov at parallels.com>
> ---
>  net.c | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
> 
> diff --git a/net.c b/net.c
> index cab7920..8b923d0 100644
> --- a/net.c
> +++ b/net.c
> @@ -97,6 +97,22 @@ static int ipv4_conf_op(char *dir, int *conf, int op)
>  		req[0].type = CTL_32;
>  		req[1].name = NULL;
>  
> +		if (strcmp("mc_forwarding", devconfs[i]) == 0 && op == CTL_WRITE) {
> +			int tmp;
> +
> +			req[0].arg = &tmp;
> +			ret = sysctl_op(req, CTL_READ);
> +			if (ret < 0) {
> +				pr_err("Failed to read %s/%s\n", dir, devconfs[i]);
> +				return -1;
> +			}
> +
> +			if (tmp != conf[i]) {
> +				pr_err("Can not set %s\n", path);
> +				return -1;
> +			}
> +			continue;
> +		}
>  		ret = sysctl_op(req, op);
>  		if (ret < 0) {
>  			pr_err("Failed to read %s/%s\n", dir, devconfs[i]);
> 



More information about the CRIU mailing list