netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Suryaputra <ssuryaextr@gmail.com>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org, brouer@redhat.com
Subject: Re: [PATCH net-next,v2] ipv6: Add rate limit mask for ICMPv6 messages
Date: Wed, 17 Apr 2019 14:13:40 -0400	[thread overview]
Message-ID: <20190417181340.GA5565@ubuntu> (raw)
In-Reply-To: <20190417.104647.29599416293735161.davem@davemloft.net>

On Wed, Apr 17, 2019 at 10:46:47AM -0700, David Miller wrote:
> From: Stephen Suryaputra <ssuryaextr@gmail.com>
> Date: Mon, 15 Apr 2019 20:31:57 -0400
> 
> > @@ -850,6 +850,14 @@ static int __net_init inet6_net_init(struct net *net)
> >  	net->ipv6.sysctl.icmpv6_echo_ignore_all = 0;
> >  	net->ipv6.sysctl.icmpv6_echo_ignore_multicast = 0;
> >  	net->ipv6.sysctl.icmpv6_echo_ignore_anycast = 0;
> > +	net->ipv6.sysctl.icmpv6_ratemask = kzalloc(ICMPV6_MSG_MAX + 1, GFP_KERNEL);
> > +	if (net->ipv6.sysctl.icmpv6_ratemask) {
> > +		/* By default, rate limit error messages.
> > +		 * Except for pmtu discovery, it would break it.
> > +		 */
> > +		bitmap_set(net->ipv6.sysctl.icmpv6_ratemask, 0, ICMPV6_ERRMSG_MAX + 1);
> > +		bitmap_clear(net->ipv6.sysctl.icmpv6_ratemask, ICMPV6_PKT_TOOBIG, 1);
> > +	}
> 
> You're allocating space for ICMPV6_MSG_MAX + 1 "bytes" but you only need enough space
> for that many "bits".  Which is just four 64-bit words, so you can probably inline it.

Doh, I thought I have divided it by 8. I will fix this and probably
inline it. Thanks.

      reply	other threads:[~2019-04-17 18:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-16  0:31 [PATCH net-next,v2] ipv6: Add rate limit mask for ICMPv6 messages Stephen Suryaputra
2019-04-17 17:46 ` David Miller
2019-04-17 18:13   ` Stephen Suryaputra [this message]

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=20190417181340.GA5565@ubuntu \
    --to=ssuryaextr@gmail.com \
    --cc=brouer@redhat.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 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).