netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Julian Anastasov <ja@ssi.bg>
To: Florian Westphal <fw@strlen.de>
Cc: hujunwei <hujunwei4@huawei.com>,
	wensong@linux-vs.org, horms@verge.net.au, pablo@netfilter.org,
	lvs-devel@vger.kernel.org, netfilter-devel@vger.kernel.org,
	Mingfangsen <mingfangsen@huawei.com>,
	wangxiaogang3@huawei.com, xuhanbing@huawei.com
Subject: Re: [PATCH net] ipvs: Improve robustness to the ipvs sysctl
Date: Mon, 29 Jul 2019 23:20:06 +0300 (EEST)	[thread overview]
Message-ID: <alpine.LFD.2.21.1907292305200.2909@ja.home.ssi.bg> (raw)
In-Reply-To: <20190729004958.GA19226@strlen.de>


	Hello,

On Mon, 29 Jul 2019, Florian Westphal wrote:

> > diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c
> > index 741d91aa4a8d..e78fd05f108b 100644
> > --- a/net/netfilter/ipvs/ip_vs_ctl.c
> > +++ b/net/netfilter/ipvs/ip_vs_ctl.c
> > @@ -1680,12 +1680,18 @@ proc_do_defense_mode(struct ctl_table *table, int write,
> >  	int val = *valp;
> >  	int rc;
> > 
> > -	rc = proc_dointvec(table, write, buffer, lenp, ppos);
> > +	struct ctl_table tmp = {
> > +		.data = &val,
> > +		.maxlen = sizeof(int),
> > +		.mode = table->mode,
> > +	};
> > +
> > +	rc = proc_dointvec(&tmp, write, buffer, lenp, ppos);
> 
> Wouldn't it be better do use proc_dointvec_minmax and set the
> constraints via .extra1,2 in the sysctl knob definition?

	We store the 'ipvs' back-ptr in extra2, so may be we
can not use it in the table for proc_do_defense_mode, only for
tmp. proc_do_sync_mode may use extra1/2 in table for the
proc_dointvec_minmax call.

Regards

--
Julian Anastasov <ja@ssi.bg>

  parent reply	other threads:[~2019-07-29 20:20 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-15 14:48 [PATCH net] ipvs: Improve robustness to the ipvs sysctl hujunwei
2019-07-29  0:49 ` Florian Westphal
2019-07-29 14:58   ` hujunwei
2019-07-29 20:20   ` Julian Anastasov [this message]
2019-07-30  2:23     ` hujunwei
2019-07-30  7:11 ` [PATCH net v2] " hujunwei
2019-07-30 19:29   ` Julian Anastasov
2019-07-31 15:58     ` hujunwei
2019-07-31 16:03   ` [PATCH net v3] " hujunwei
2019-07-31 17:53     ` Julian Anastasov
2019-08-03 16:40       ` Pablo Neira Ayuso

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LFD.2.21.1907292305200.2909@ja.home.ssi.bg \
    --to=ja@ssi.bg \
    --cc=fw@strlen.de \
    --cc=horms@verge.net.au \
    --cc=hujunwei4@huawei.com \
    --cc=lvs-devel@vger.kernel.org \
    --cc=mingfangsen@huawei.com \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.org \
    --cc=wangxiaogang3@huawei.com \
    --cc=wensong@linux-vs.org \
    --cc=xuhanbing@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).