[NET]: dev: secondary unicast address support
Add support for configuring secondary unicast addresses on network devices. To support this devices capable of filtering multiple unicast addresses need to change their set_multicast_list function to configure unicast filters as well and assign it to dev->set_rx_mode instead of dev->set_multicast_list. Other devices are put into promiscous mode when secondary unicast addresses are present. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
3fba5a8b1e
commit
4417da668c
@ -63,39 +63,6 @@
|
||||
* We block accesses to device mc filters with netif_tx_lock.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Update the multicast list into the physical NIC controller.
|
||||
*/
|
||||
|
||||
static void __dev_mc_upload(struct net_device *dev)
|
||||
{
|
||||
/* Don't do anything till we up the interface
|
||||
* [dev_open will call this function so the list will
|
||||
* stay sane]
|
||||
*/
|
||||
|
||||
if (!(dev->flags&IFF_UP))
|
||||
return;
|
||||
|
||||
/*
|
||||
* Devices with no set multicast or which have been
|
||||
* detached don't get set.
|
||||
*/
|
||||
|
||||
if (dev->set_multicast_list == NULL ||
|
||||
!netif_device_present(dev))
|
||||
return;
|
||||
|
||||
dev->set_multicast_list(dev);
|
||||
}
|
||||
|
||||
void dev_mc_upload(struct net_device *dev)
|
||||
{
|
||||
netif_tx_lock_bh(dev);
|
||||
__dev_mc_upload(dev);
|
||||
netif_tx_unlock_bh(dev);
|
||||
}
|
||||
|
||||
/*
|
||||
* Delete a device level multicast
|
||||
*/
|
||||
@ -114,7 +81,7 @@ int dev_mc_delete(struct net_device *dev, void *addr, int alen, int glbl)
|
||||
* loaded filter is now wrong. Fix it
|
||||
*/
|
||||
|
||||
__dev_mc_upload(dev);
|
||||
__dev_set_rx_mode(dev);
|
||||
}
|
||||
netif_tx_unlock_bh(dev);
|
||||
return err;
|
||||
@ -132,7 +99,7 @@ int dev_mc_add(struct net_device *dev, void *addr, int alen, int glbl)
|
||||
err = __dev_addr_add(&dev->mc_list, addr, alen, glbl);
|
||||
if (!err) {
|
||||
dev->mc_count++;
|
||||
__dev_mc_upload(dev);
|
||||
__dev_set_rx_mode(dev);
|
||||
}
|
||||
netif_tx_unlock_bh(dev);
|
||||
return err;
|
||||
|
Reference in New Issue
Block a user