Files
linux/net/ipv6
WANG Cong 8795ee7bed ipv6: reorder ip6_route_dev_notifier after ipv6_dev_notf
[ Upstream commit 242d3a49a2 ]

For each netns (except init_net), we initialize its null entry
in 3 places:

1) The template itself, as we use kmemdup()
2) Code around dst_init_metrics() in ip6_route_net_init()
3) ip6_route_dev_notify(), which is supposed to initialize it after
   loopback registers

Unfortunately the last one still happens in a wrong order because
we expect to initialize net->ipv6.ip6_null_entry->rt6i_idev to
net->loopback_dev's idev, thus we have to do that after we add
idev to loopback. However, this notifier has priority == 0 same as
ipv6_dev_notf, and ipv6_dev_notf is registered after
ip6_route_dev_notifier so it is called actually after
ip6_route_dev_notifier. This is similar to commit 2f460933f5
("ipv6: initialize route null entry in addrconf_init()") which
fixes init_net.

Fix it by picking a smaller priority for ip6_route_dev_notifier.
Also, we have to release the refcnt accordingly when unregistering
loopback_dev because device exit functions are called before subsys
exit functions.

Acked-by: David Ahern <dsahern@gmail.com>
Tested-by: David Ahern <dsahern@gmail.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-14 14:00:21 +02:00
..
2015-08-25 13:37:31 -07:00
2016-09-10 23:12:51 -07:00
2016-11-28 16:13:01 -05:00
2017-03-22 12:43:31 +01:00
2016-05-31 14:07:49 -07:00
2016-09-10 23:12:52 -07:00
2017-02-18 15:11:43 +01:00
2016-06-27 15:06:17 -04:00
2017-03-22 12:43:34 +01:00
2015-02-28 16:56:51 -05:00
2015-11-03 10:52:13 -05:00
2016-09-21 10:09:14 +02:00
2016-09-21 10:09:14 +02:00