Skip to content

Commit f1f28aa

Browse files
committed
netdev: Add addr_list_lock to struct net_device.
This will be used to protect the per-device unicast and multicast address lists, as well as the callbacks into the drivers which configure such state such as ->set_rx_mode() and ->set_multicast_list(). Signed-off-by: David S. Miller <[email protected]>
1 parent f66ac03 commit f1f28aa

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

include/linux/netdevice.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -609,6 +609,7 @@ struct net_device
609609
unsigned char addr_len; /* hardware address length */
610610
unsigned short dev_id; /* for shared network cards */
611611

612+
spinlock_t addr_list_lock;
612613
struct dev_addr_list *uc_list; /* Secondary unicast mac addresses */
613614
int uc_count; /* Number of installed ucasts */
614615
int uc_promisc;

net/core/dev.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3836,6 +3836,7 @@ int register_netdevice(struct net_device *dev)
38363836
BUG_ON(!dev_net(dev));
38373837
net = dev_net(dev);
38383838

3839+
spin_lock_init(&dev->addr_list_lock);
38393840
netdev_init_queue_locks(dev);
38403841

38413842
dev->iflink = -1;

0 commit comments

Comments
 (0)