From: Arnd Bergmann <arnd@arndb.de>
To: Nikolay Borisov <kernel@kyup.com>
Cc: "David S. Miller" <davem@davemloft.net>,
Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>,
James Morris <jmorris@namei.org>,
Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>,
Patrick McHardy <kaber@trash.net>,
linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: igmp: use IS_ENABLED(CONFIG_IP_MULTICAST) instead of ifdef
Date: Tue, 16 Feb 2016 17:33:18 +0100 [thread overview]
Message-ID: <13046365.7R7s0XiHQi@wuerfel> (raw)
In-Reply-To: <56C34A0C.9040207@kyup.com>
On Tuesday 16 February 2016 18:10:52 Nikolay Borisov wrote:
> On 02/16/2016 05:59 PM, Arnd Bergmann wrote:
> > @@ -1821,17 +1807,15 @@ static int ip_mc_del_src(struct in_device *in_dev, __be32 *pmca, int sfmode,
> > if (!err && rv < 0)
> > err = rv;
> > }
> > - if (pmc->sfmode == MCAST_EXCLUDE &&
> > + if (IS_ENABLED(CONFIG_IP_MULTICAST) &&
> > + pmc->sfmode == MCAST_EXCLUDE &&
> > pmc->sfcount[MCAST_EXCLUDE] == 0 &&
> > pmc->sfcount[MCAST_INCLUDE]) {
> > -#ifdef CONFIG_IP_MULTICAST
> > struct ip_sf_list *psf;
> > struct net *net = dev_net(in_dev->dev);
> > -#endif
> >
> > /* filter mode change */
> > pmc->sfmode = MCAST_INCLUDE;
>
> The above line was always executed, whereas now it wouldn't execute
> unless IS_ENABLED passes.
This was not intentional, I've sent a v2 patch to fix it up now, and
tried to simplify it a little further, making the logic the
same for ip_mc_del_src and ip_mc_add_src.
> > /*
> > * Add multicast source filter list to the interface list
> > @@ -1977,9 +1961,7 @@ static int ip_mc_add_src(struct in_device *in_dev, __be32 *pmca, int sfmode,
> > spin_lock_bh(&pmc->lock);
> > rcu_read_unlock();
> >
> > -#ifdef CONFIG_IP_MULTICAST
> > sf_markstate(pmc);
> > -#endif
>
> This would be executed unconditionally, which is contrary to the
> original intention. Dunno if it makes a difference though.
This was intentional, I have changed sf_markstate() to do nothing when
IP_MULTICAST is disabled. However, there was another caller where
I should have done the same thing rather than adding an if().
> Reviewed-by: Nikolay Borisov <kernel@kyup.com>
Thanks!
Arnd
prev parent reply other threads:[~2016-02-16 16:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-16 15:59 [PATCH] net: igmp: use IS_ENABLED(CONFIG_IP_MULTICAST) instead of ifdef Arnd Bergmann
2016-02-16 16:10 ` Nikolay Borisov
2016-02-16 16:33 ` Arnd Bergmann [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=13046365.7R7s0XiHQi@wuerfel \
--to=arnd@arndb.de \
--cc=davem@davemloft.net \
--cc=jmorris@namei.org \
--cc=kaber@trash.net \
--cc=kernel@kyup.com \
--cc=kuznet@ms2.inr.ac.ru \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=yoshfuji@linux-ipv6.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