Commit cba3e28f authored by Kefeng Wang's avatar Kefeng Wang Committed by Willy Tarreau

ipv6: addrconf: Avoid addrconf_disable_change() using RCU read-side lock

commit 03e4deff upstream.

Just like commit 4acd4945 ("ipv6: addrconf: Avoid calling
netdevice notifiers with RCU read-side lock"), it is unnecessary
to make addrconf_disable_change() use RCU iteration over the
netdev list, since it already holds the RTNL lock, or we may meet
Illegal context switch in RCU read-side critical section.
Signed-off-by: default avatarKefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarWilly Tarreau <w@1wt.eu>
parent 379fa3e8
...@@ -4768,8 +4768,7 @@ static void addrconf_disable_change(struct net *net, __s32 newf) ...@@ -4768,8 +4768,7 @@ static void addrconf_disable_change(struct net *net, __s32 newf)
struct net_device *dev; struct net_device *dev;
struct inet6_dev *idev; struct inet6_dev *idev;
rcu_read_lock(); for_each_netdev(net, dev) {
for_each_netdev_rcu(net, dev) {
idev = __in6_dev_get(dev); idev = __in6_dev_get(dev);
if (idev) { if (idev) {
int changed = (!idev->cnf.disable_ipv6) ^ (!newf); int changed = (!idev->cnf.disable_ipv6) ^ (!newf);
...@@ -4778,7 +4777,6 @@ static void addrconf_disable_change(struct net *net, __s32 newf) ...@@ -4778,7 +4777,6 @@ static void addrconf_disable_change(struct net *net, __s32 newf)
dev_disable_change(idev); dev_disable_change(idev);
} }
} }
rcu_read_unlock();
} }
static int addrconf_disable_ipv6(struct ctl_table *table, int *p, int newf) static int addrconf_disable_ipv6(struct ctl_table *table, int *p, int newf)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment