You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
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>
This commit is contained in:
@@ -300,7 +300,9 @@ static int sp_set_mac_address(struct net_device *dev, void *addr)
|
||||
struct sockaddr_ax25 *sa = addr;
|
||||
|
||||
netif_tx_lock_bh(dev);
|
||||
netif_addr_lock(dev);
|
||||
memcpy(dev->dev_addr, &sa->sax25_call, AX25_ADDR_LEN);
|
||||
netif_addr_unlock(dev);
|
||||
netif_tx_unlock_bh(dev);
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -356,7 +356,9 @@ static int ax_set_mac_address(struct net_device *dev, void *addr)
|
||||
struct sockaddr_ax25 *sa = addr;
|
||||
|
||||
netif_tx_lock_bh(dev);
|
||||
netif_addr_lock(dev);
|
||||
memcpy(dev->dev_addr, &sa->sax25_call, AX25_ADDR_LEN);
|
||||
netif_addr_unlock(dev);
|
||||
netif_tx_unlock_bh(dev);
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user