Commit d632ce98 authored by nikolay@redhat.com's avatar nikolay@redhat.com Committed by David S. Miller

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: default avatarNikolay Aleksandrov <nikolay@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fc7a72ac
...@@ -846,8 +846,10 @@ static void bond_mc_swap(struct bonding *bond, struct slave *new_active, ...@@ -846,8 +846,10 @@ static void bond_mc_swap(struct bonding *bond, struct slave *new_active,
if (bond->dev->flags & IFF_ALLMULTI) if (bond->dev->flags & IFF_ALLMULTI)
dev_set_allmulti(old_active->dev, -1); dev_set_allmulti(old_active->dev, -1);
netif_addr_lock_bh(bond->dev);
netdev_for_each_mc_addr(ha, bond->dev) netdev_for_each_mc_addr(ha, bond->dev)
dev_mc_del(old_active->dev, ha->addr); dev_mc_del(old_active->dev, ha->addr);
netif_addr_unlock_bh(bond->dev);
} }
if (new_active) { if (new_active) {
...@@ -858,8 +860,10 @@ static void bond_mc_swap(struct bonding *bond, struct slave *new_active, ...@@ -858,8 +860,10 @@ static void bond_mc_swap(struct bonding *bond, struct slave *new_active,
if (bond->dev->flags & IFF_ALLMULTI) if (bond->dev->flags & IFF_ALLMULTI)
dev_set_allmulti(new_active->dev, 1); dev_set_allmulti(new_active->dev, 1);
netif_addr_lock_bh(bond->dev);
netdev_for_each_mc_addr(ha, bond->dev) netdev_for_each_mc_addr(ha, bond->dev)
dev_mc_add(new_active->dev, ha->addr); dev_mc_add(new_active->dev, ha->addr);
netif_addr_unlock_bh(bond->dev);
} }
} }
......
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