From: Joe Perches <joe@perches.com>
To: David Miller <davem@davemloft.net>, adobriyan@gmail.com
Cc: Linyu.Yuan@alcatel-sbell.com.cn, netdev@vger.kernel.org
Subject: Re: [PATCH net-next] net: ndisc.c: reduce size of __ndisc_fill_addr_option()
Date: Mon, 29 May 2017 21:24:21 -0700 [thread overview]
Message-ID: <1496118261.2618.12.camel@perches.com> (raw)
In-Reply-To: <20170529.233109.702640863399503414.davem@davemloft.net>
On Mon, 2017-05-29 at 23:31 -0400, David Miller wrote:
> From: Alexey Dobriyan <adobriyan@gmail.com>
> 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, space);
> >> +
> >> + memset(opt, 0, space);
> >
> > This can't be right.
> >
> > And what size are you reducing?
>
> It is right, space equals the same thing it would have equaled
> before his changes, and a memset() of zero length will do the
> right thing.
>
> Finally, if space can be negative here, we have real problems.
__ndisc_fill_addr_option is exported so yeah.
next prev parent reply other threads:[~2017-05-30 4:24 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-27 15:15 [PATCH net-next] net: ndisc.c: reduce size of __ndisc_fill_addr_option() Alexey Dobriyan
2017-05-30 3:31 ` David Miller
2017-05-30 4:24 ` Joe Perches [this message]
-- strict thread matches above, loose matches on Subject: below --
2017-05-26 22:00 yuan linyu
2017-05-30 3:30 ` David Miller
2017-05-30 3:41 ` Joe Perches
2017-05-30 3:42 ` David Ahern
2017-05-31 0:07 ` YUAN Linyu
2017-05-31 0:29 ` YUAN Linyu
2017-05-31 0:39 ` David Ahern
2017-05-31 1:00 ` YUAN Linyu
2017-05-31 0:06 ` YUAN Linyu
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=1496118261.2618.12.camel@perches.com \
--to=joe@perches.com \
--cc=Linyu.Yuan@alcatel-sbell.com.cn \
--cc=adobriyan@gmail.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.