summaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authornikolay@redhat.com <nikolay@redhat.com>2013-04-18 09:33:38 +0200
committerDavid S. Miller <davem@davemloft.net>2013-04-19 23:48:19 +0200
commitd632ce989c811863a1ce9b1c53dae2cf06b35c49 (patch)
treede50df492d43f49a83af0ec2fa029d8855d55dd6 /drivers/net
parentbonding: disable netpoll on enslave failure (diff)
downloadlinux-d632ce989c811863a1ce9b1c53dae2cf06b35c49.tar.xz
linux-d632ce989c811863a1ce9b1c53dae2cf06b35c49.zip
bonding: in bond_mc_swap() bond's mc addr list is walked without lock
Use netif_addr_lock_bh() to acquire the appropriate lock before walking. Signed-off-by: Nikolay Aleksandrov <nikolay@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/bonding/bond_main.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index ae35b28a39e4..dbbea0eec134 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -846,8 +846,10 @@ static void bond_mc_swap(struct bonding *bond, struct slave *new_active,
if (bond->dev->flags & IFF_ALLMULTI)
dev_set_allmulti(old_active->dev, -1);
+ netif_addr_lock_bh(bond->dev);
netdev_for_each_mc_addr(ha, bond->dev)
dev_mc_del(old_active->dev, ha->addr);
+ netif_addr_unlock_bh(bond->dev);
}
if (new_active) {
@@ -858,8 +860,10 @@ static void bond_mc_swap(struct bonding *bond, struct slave *new_active,
if (bond->dev->flags & IFF_ALLMULTI)
dev_set_allmulti(new_active->dev, 1);
+ netif_addr_lock_bh(bond->dev);
netdev_for_each_mc_addr(ha, bond->dev)
dev_mc_add(new_active->dev, ha->addr);
+ netif_addr_unlock_bh(bond->dev);
}
}