ipv6: give an IPv6 dev to blackhole_netdev
authorEric Dumazet <edumazet@google.com>
Thu, 10 Feb 2022 21:42:29 +0000 (13:42 -0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 11 Feb 2022 11:44:27 +0000 (11:44 +0000)
commite5f80fcf869a18cc750d6b350bbfac82df292e0b
treecb0581c02f68e783da214365d835b1ad49db4961
parent2d4feb2c1ba728fe53d6f80705b2d7e5c5b666a5
ipv6: give an IPv6 dev to blackhole_netdev

IPv6 addrconf notifiers wants the loopback device to
be the last device being dismantled at netns deletion.

This caused many limitations and work arounds.

Back in linux-5.3, Mahesh added a per host blackhole_netdev
that can be used whenever we need to make sure objects no longer
refer to a disappearing device.

If we attach to blackhole_netdev an ip6_ptr (allocate an idev),
then we can use this special device (which is never freed)
in place of the loopback_dev (which can be freed).

This will permit improvements in netdev_run_todo() and other parts
of the stack where had steps to make sure loopback_dev was
the last device to disappear.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Mahesh Bandewar <maheshb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/addrconf.c
net/ipv6/route.c