lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20220119060844.GA14367@dhcp-10-157-36-190>
Date:   Wed, 19 Jan 2022 14:08:44 +0800
From:   Geliang Tang <geliang.tang@...e.com>
To:     David Ahern <dsahern@...il.com>
Cc:     David Ahern <dsahern@...nel.org>,
        Mat Martineau <mathew.j.martineau@...ux.intel.com>,
        netdev@...r.kernel.org, mptcp@...ts.linux.dev
Subject: Re: [PATCH iproute2-next] mptcp: add id check for deleting address

Hi David,

Thanks for your review.

On Sat, Jan 15, 2022 at 08:42:25AM -0700, David Ahern wrote:
> On 1/14/22 5:10 PM, Geliang Tang wrote:
> > This patch added the id check for deleting address in mptcp_parse_opt().
> > The ADDRESS argument is invalid for the non-zero id address, only needed
> > for the id 0 address.
> > 
> >  # ip mptcp endpoint delete id 1
> >  # ip mptcp endpoint delete id 0 10.0.1.1
> > 
> > Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/171
> 
> meaning bug fix? If so please add a Fixes tag with the commit that
> should have required the id.

This patch isn't a fix, no Fixes tag needed. I dropped the Closes tag in
v2.

> 
> > Signed-off-by: Geliang Tang <geliang.tang@...e.com>
> > Acked-by: Mat Martineau <mathew.j.martineau@...ux.intel.com>
> > ---
> >  ip/ipmptcp.c        | 11 +++++++++--
> >  man/man8/ip-mptcp.8 | 16 +++++++++++++++-
> >  2 files changed, 24 insertions(+), 3 deletions(-)
> > 
> > diff --git a/ip/ipmptcp.c b/ip/ipmptcp.c
> > index e7150138..4363e753 100644
> > --- a/ip/ipmptcp.c
> > +++ b/ip/ipmptcp.c
> > @@ -24,7 +24,7 @@ static void usage(void)
> >  	fprintf(stderr,
> >  		"Usage:	ip mptcp endpoint add ADDRESS [ dev NAME ] [ id ID ]\n"
> >  		"				      [ port NR ] [ FLAG-LIST ]\n"
> > -		"	ip mptcp endpoint delete id ID\n"
> > +		"	ip mptcp endpoint delete id ID [ ADDRESS ]\n"
> >  		"	ip mptcp endpoint change id ID [ backup | nobackup ]\n"
> >  		"	ip mptcp endpoint show [ id ID ]\n"
> >  		"	ip mptcp endpoint flush\n"
> > @@ -103,6 +103,7 @@ static int get_flags(const char *arg, __u32 *flags)
> >  static int mptcp_parse_opt(int argc, char **argv, struct nlmsghdr *n, int cmd)
> >  {
> >  	bool adding = cmd == MPTCP_PM_CMD_ADD_ADDR;
> > +	bool deling = cmd == MPTCP_PM_CMD_DEL_ADDR;
> >  	struct rtattr *attr_addr;
> >  	bool addr_set = false;
> >  	inet_prefix address;
> > @@ -156,8 +157,14 @@ static int mptcp_parse_opt(int argc, char **argv, struct nlmsghdr *n, int cmd)
> >  	if (!addr_set && adding)
> >  		missarg("ADDRESS");
> >  
> > -	if (!id_set && !adding)
> > +	if (!id_set && deling)
> >  		missarg("ID");
> > +	else if (id_set && deling) {
> 
> brackets on the 'if () { .. }' since they are needed on the else.

Updated in v2. And v2 was sent out a few days ago.

Thanks,
-Geliang

> 
> > +		if (id && addr_set)
> > +			invarg("invalid for non-zero id address\n", "ADDRESS");
> > +		else if (!id && !addr_set)
> > +			invarg("address is needed for deleting id 0 address\n", "ID");
> > +	}
> >  
> >  	if (port && !(flags & MPTCP_PM_ADDR_FLAG_SIGNAL))
> >  		invarg("flags must have signal when using port", "port");
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ