diff options
author | David S. Miller <davem@davemloft.net> | 2008-07-15 03:13:44 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-07-15 03:13:44 -0400 |
commit | e308a5d806c852f56590ffdd3834d0df0cbed8d7 (patch) | |
tree | 294ff654e90950f5162737c26f4799b0b710b748 /drivers/net/bonding | |
parent | f1f28aa3510ddb84c966bac65611bb866c77a092 (diff) |
netdev: Add netdev->addr_list_lock protection.
Add netif_addr_{lock,unlock}{,_bh}() helpers.
Use them to protect operations that operate on or read
the network device unicast and multicast address lists.
Also use them in cases where the code simply wants to
block calls into the driver's ->set_rx_mode() and
->set_multicast_list() methods.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding')
-rw-r--r-- | drivers/net/bonding/bond_main.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 8ae7ff313218..ea71abd6f728 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -1568,10 +1568,12 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) | |||
1568 | } | 1568 | } |
1569 | 1569 | ||
1570 | netif_tx_lock_bh(bond_dev); | 1570 | netif_tx_lock_bh(bond_dev); |
1571 | netif_addr_lock(bond_dev); | ||
1571 | /* upload master's mc_list to new slave */ | 1572 | /* upload master's mc_list to new slave */ |
1572 | for (dmi = bond_dev->mc_list; dmi; dmi = dmi->next) { | 1573 | for (dmi = bond_dev->mc_list; dmi; dmi = dmi->next) { |
1573 | dev_mc_add (slave_dev, dmi->dmi_addr, dmi->dmi_addrlen, 0); | 1574 | dev_mc_add (slave_dev, dmi->dmi_addr, dmi->dmi_addrlen, 0); |
1574 | } | 1575 | } |
1576 | netif_addr_unlock(bond_dev); | ||
1575 | netif_tx_unlock_bh(bond_dev); | 1577 | netif_tx_unlock_bh(bond_dev); |
1576 | } | 1578 | } |
1577 | 1579 | ||
@@ -1937,7 +1939,9 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_dev) | |||
1937 | 1939 | ||
1938 | /* flush master's mc_list from slave */ | 1940 | /* flush master's mc_list from slave */ |
1939 | netif_tx_lock_bh(bond_dev); | 1941 | netif_tx_lock_bh(bond_dev); |
1942 | netif_addr_lock(bond_dev); | ||
1940 | bond_mc_list_flush(bond_dev, slave_dev); | 1943 | bond_mc_list_flush(bond_dev, slave_dev); |
1944 | netif_addr_unlock(bond_dev); | ||
1941 | netif_tx_unlock_bh(bond_dev); | 1945 | netif_tx_unlock_bh(bond_dev); |
1942 | } | 1946 | } |
1943 | 1947 | ||
@@ -2060,7 +2064,9 @@ static int bond_release_all(struct net_device *bond_dev) | |||
2060 | 2064 | ||
2061 | /* flush master's mc_list from slave */ | 2065 | /* flush master's mc_list from slave */ |
2062 | netif_tx_lock_bh(bond_dev); | 2066 | netif_tx_lock_bh(bond_dev); |
2067 | netif_addr_lock(bond_dev); | ||
2063 | bond_mc_list_flush(bond_dev, slave_dev); | 2068 | bond_mc_list_flush(bond_dev, slave_dev); |
2069 | netif_addr_unlock(bond_dev); | ||
2064 | netif_tx_unlock_bh(bond_dev); | 2070 | netif_tx_unlock_bh(bond_dev); |
2065 | } | 2071 | } |
2066 | 2072 | ||
@@ -4674,7 +4680,9 @@ static void bond_free_all(void) | |||
4674 | 4680 | ||
4675 | bond_work_cancel_all(bond); | 4681 | bond_work_cancel_all(bond); |
4676 | netif_tx_lock_bh(bond_dev); | 4682 | netif_tx_lock_bh(bond_dev); |
4683 | netif_addr_lock(bond_dev); | ||
4677 | bond_mc_list_destroy(bond); | 4684 | bond_mc_list_destroy(bond); |
4685 | netif_addr_unlock(bond_dev); | ||
4678 | netif_tx_unlock_bh(bond_dev); | 4686 | netif_tx_unlock_bh(bond_dev); |
4679 | /* Release the bonded slaves */ | 4687 | /* Release the bonded slaves */ |
4680 | bond_release_all(bond_dev); | 4688 | bond_release_all(bond_dev); |