RE: [PATCH net-next] net: ndisc.c: reduce size of __ndisc_fill_addr_option()

2017-05-30 Thread YUAN Linyu
Ok, I will send v2 later > -Original Message- > From: David Ahern [mailto:dsah...@gmail.com] > Sent: Wednesday, May 31, 2017 8:40 AM > To: YUAN Linyu; David Ahern; Joe Perches; David Miller; cug...@163.com > Cc: netdev@vger.kernel.org > Subject: Re: [PATCH net-next] ne

Re: [PATCH net-next] net: ndisc.c: reduce size of __ndisc_fill_addr_option()

2017-05-30 Thread David Ahern
On 5/30/17 6:29 PM, YUAN Linyu wrote: >>> that function should be converted to skb_put_zero once it hits net-next. >> I will check it > I can't find skb_put_zero I believe the decision was to put it in Johannes' tree and it will make its way to DaveM's tree. Give some time.

RE: [PATCH net-next] net: ndisc.c: reduce size of __ndisc_fill_addr_option()

2017-05-30 Thread YUAN Linyu
> > -Original Message- > > From: David Ahern [mailto:dsah...@gmail.com] > > Sent: Tuesday, May 30, 2017 11:42 AM > > To: Joe Perches; David Miller; cug...@163.com > > Cc: netdev@vger.kernel.org; YUAN Linyu > > Subject: Re: [PATCH ne

RE: [PATCH net-next] net: ndisc.c: reduce size of __ndisc_fill_addr_option()

2017-05-30 Thread YUAN Linyu
> -Original Message- > From: David Ahern [mailto:dsah...@gmail.com] > Sent: Tuesday, May 30, 2017 11:42 AM > To: Joe Perches; David Miller; cug...@163.com > Cc: netdev@vger.kernel.org; YUAN Linyu > Subject: Re: [PATCH net-next] net: ndisc.c: reduce size of > __n

RE: [PATCH net-next] net: ndisc.c: reduce size of __ndisc_fill_addr_option()

2017-05-30 Thread YUAN Linyu
; Subject: Re: [PATCH net-next] net: ndisc.c: reduce size of > __ndisc_fill_addr_option() > > On Mon, 2017-05-29 at 23:30 -0400, David Miller wrote: > > From: yuan linyu > > Date: Sat, 27 May 2017 06:00:52 +0800 > > > > > From: yuan linyu > > > > >

Re: [PATCH net-next] net: ndisc.c: reduce size of __ndisc_fill_addr_option()

2017-05-29 Thread Joe Perches
On Mon, 2017-05-29 at 23:31 -0400, David Miller wrote: > From: Alexey Dobriyan > Date: Sat, 27 May 2017 18:15:14 +0300 > > >> --- a/net/ipv6/ndisc.c > >> +++ b/net/ipv6/ndisc.c > >> @@ -148,17 +148,18 @@ void __ndisc_fill_addr_option(struct sk_buff *skb, > >> int type, void *data, > > > >> 

Re: [PATCH net-next] net: ndisc.c: reduce size of __ndisc_fill_addr_option()

2017-05-29 Thread David Ahern
On 5/29/17 9:41 PM, Joe Perches wrote: > On Mon, 2017-05-29 at 23:30 -0400, David Miller wrote: >> From: yuan linyu >> Date: Sat, 27 May 2017 06:00:52 +0800 >> >>> From: yuan linyu >>> >>> Signed-off-by: yuan linyu >> Applied, thanks. > OK, but is it really safe though? > > Could "space" (an in

Re: [PATCH net-next] net: ndisc.c: reduce size of __ndisc_fill_addr_option()

2017-05-29 Thread Joe Perches
On Mon, 2017-05-29 at 23:30 -0400, David Miller wrote: > From: yuan linyu > Date: Sat, 27 May 2017 06:00:52 +0800 > > > From: yuan linyu > > > > Signed-off-by: yuan linyu > > Applied, thanks. OK, but is it really safe though? Could "space" (an int) ever be negative after subtracting "pad" a

Re: [PATCH net-next] net: ndisc.c: reduce size of __ndisc_fill_addr_option()

2017-05-29 Thread David Miller
From: Alexey Dobriyan Date: Sat, 27 May 2017 18:15:14 +0300 >> --- a/net/ipv6/ndisc.c >> +++ b/net/ipv6/ndisc.c >> @@ -148,17 +148,18 @@ void __ndisc_fill_addr_option(struct sk_buff *skb, int >> type, void *data, > >> space -= data_len; >> -if (space > 0) >> -memset(opt, 0,

Re: [PATCH net-next] net: ndisc.c: reduce size of __ndisc_fill_addr_option()

2017-05-29 Thread David Miller
From: yuan linyu Date: Sat, 27 May 2017 06:00:52 +0800 > From: yuan linyu > > Signed-off-by: yuan linyu Applied, thanks.

Re: [PATCH net-next] net: ndisc.c: reduce size of __ndisc_fill_addr_option()

2017-05-27 Thread Alexey Dobriyan
> --- a/net/ipv6/ndisc.c > +++ b/net/ipv6/ndisc.c > @@ -148,17 +148,18 @@ void __ndisc_fill_addr_option(struct sk_buff *skb, int > type, void *data, > space -= data_len; > - if (space > 0) > - memset(opt, 0, space); > + > + memset(opt, 0, space); This can't be right. A