]> err.no Git - linux-2.6/commitdiff
netdev: Add addr_list_lock to struct net_device.
authorDavid S. Miller <davem@davemloft.net>
Tue, 15 Jul 2008 07:08:33 +0000 (00:08 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 15 Jul 2008 07:08:33 +0000 (00:08 -0700)
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 <davem@davemloft.net>
include/linux/netdevice.h
net/core/dev.c

index ba5c4639ea91a58a25094c9ccde58ef7eb762f78..fd0365219181cfae78c7b61fbffd14fa1eb2a255 100644 (file)
@@ -609,6 +609,7 @@ struct net_device
        unsigned char           addr_len;       /* hardware address length      */
        unsigned short          dev_id;         /* for shared network cards */
 
+       spinlock_t              addr_list_lock;
        struct dev_addr_list    *uc_list;       /* Secondary unicast mac addresses */
        int                     uc_count;       /* Number of installed ucasts   */
        int                     uc_promisc;
index feaab4898a5b9a3d0385cad0e5bfca4d9c019319..d933d1bfa6fa0c6ca1d704fe15be934657294715 100644 (file)
@@ -3836,6 +3836,7 @@ int register_netdevice(struct net_device *dev)
        BUG_ON(!dev_net(dev));
        net = dev_net(dev);
 
+       spin_lock_init(&dev->addr_list_lock);
        netdev_init_queue_locks(dev);
 
        dev->iflink = -1;