[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <451780c0-d70e-d9aa-5073-9a69455c9e11@gmail.com>
Date: Tue, 10 Mar 2020 12:17:33 +0100
From: Rafał Miłecki <zajec5@...il.com>
To: Hangbin Liu <liuhangbin@...il.com>, netdev@...r.kernel.org
Cc: Hideaki YOSHIFUJI <yoshfuji@...ux-ipv6.org>,
"David S . Miller" <davem@...emloft.net>,
Eric Dumazet <eric.dumazet@...il.com>,
Alexey Kuznetsov <kuznet@....inr.ac.ru>,
John Crispin <john@...ozen.org>,
Herbert Xu <herbert@...dor.apana.org.au>
Subject: Re: [PATCHv2 net] ipv6/addrconf: call ipv6_mc_up() for non-Ethernet
interface
On 10.03.2020 08:27, Hangbin Liu wrote:
> Rafał found an issue that for non-Ethernet interface, if we down and up
> frequently, the memory will be consumed slowly.
>
> The reason is we add allnodes/allrouters addressed in multicast list in
> ipv6_add_dev(). When link down, we call ipv6_mc_down(), store all multicast
> addresses via mld_add_delrec(). But when link up, we don't call ipv6_mc_up()
> for non-Ethernet interface to remove the addresses. This makes idev->mc_tomb
> getting bigger and bigger. The call stack looks like:
>
> addrconf_notify(NETDEV_REGISTER)
> ipv6_add_dev
> ipv6_dev_mc_inc(ff01::1)
> ipv6_dev_mc_inc(ff02::1)
> ipv6_dev_mc_inc(ff02::2)
>
> addrconf_notify(NETDEV_UP)
> addrconf_dev_config
> /* Alas, we support only Ethernet autoconfiguration. */
> return;
>
> addrconf_notify(NETDEV_DOWN)
> addrconf_ifdown
> ipv6_mc_down
> igmp6_group_dropped(ff02::2)
> mld_add_delrec(ff02::2)
> igmp6_group_dropped(ff02::1)
> igmp6_group_dropped(ff01::1)
>
> After investigating, I can't found a rule to disable multicast on
> non-Ethernet interface. In RFC2460, the link could be Ethernet, PPP, ATM,
> tunnels, etc. In IPv4, it doesn't check the dev type when calls ip_mc_up()
> in inetdev_event(). Even for IPv6, we don't check the dev type and call
> ipv6_add_dev(), ipv6_dev_mc_inc() after register device.
>
> So I think it's OK to fix this memory consumer by calling ipv6_mc_up() for
> non-Ethernet interface.
>
> v2: Also check IFF_MULTICAST flag to make sure the interface supports
> multicast
>
> Reported-by: Rafał Miłecki <zajec5@...il.com>
> Fixes: 74235a25c673 ("[IPV6] addrconf: Fix IPv6 on tuntap tunnels")
> Fixes: 1666d49e1d41 ("mld: do not remove mld souce list info when set link down")
> Signed-off-by: Hangbin Liu <liuhangbin@...il.com>
I'm really grateful for all your help. I verified this patch to fix
reported issue. Thank you!
Powered by blists - more mailing lists