diff options
author | Eric Dumazet <edumazet@google.com> | 2012-08-22 17:50:59 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-08-23 12:24:42 -0400 |
commit | 748e2d9396a18c3fd3d07d47c1b41320acf1fbf4 (patch) | |
tree | 49bde8c370615258baada1d43acda2b3fb3625c2 /net/ipv6/addrconf.c | |
parent | 0fa7fa98dbcc2789409ed24e885485e645803d7f (diff) |
net: reinstate rtnl in call_netdevice_notifiers()
Eric Biederman pointed out that not holding RTNL while calling
call_netdevice_notifiers() was racy.
This patch is a direct transcription his feedback
against commit 0115e8e30d6fc (net: remove delay at device dismantle)
Thanks Eric !
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Tom Herbert <therbert@google.com>
Cc: Mahesh Bandewar <maheshb@google.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Gao feng <gaofeng@cn.fujitsu.com>
Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/addrconf.c')
-rw-r--r-- | net/ipv6/addrconf.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index e581009cb09e..6bc85f7c31e3 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
@@ -2566,14 +2566,10 @@ static int addrconf_notify(struct notifier_block *this, unsigned long event, | |||
2566 | void *data) | 2566 | void *data) |
2567 | { | 2567 | { |
2568 | struct net_device *dev = (struct net_device *) data; | 2568 | struct net_device *dev = (struct net_device *) data; |
2569 | struct inet6_dev *idev; | 2569 | struct inet6_dev *idev = __in6_dev_get(dev); |
2570 | int run_pending = 0; | 2570 | int run_pending = 0; |
2571 | int err; | 2571 | int err; |
2572 | 2572 | ||
2573 | if (event == NETDEV_UNREGISTER_FINAL) | ||
2574 | return NOTIFY_DONE; | ||
2575 | |||
2576 | idev = __in6_dev_get(dev); | ||
2577 | switch (event) { | 2573 | switch (event) { |
2578 | case NETDEV_REGISTER: | 2574 | case NETDEV_REGISTER: |
2579 | if (!idev && dev->mtu >= IPV6_MIN_MTU) { | 2575 | if (!idev && dev->mtu >= IPV6_MIN_MTU) { |