summaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorDenis Cheng <crquan@gmail.com>2007-07-18 02:12:03 -0700
committerDavid S. Miller <davem@davemloft.net>2007-07-18 02:12:03 -0700
commit26cc2522cb6ebf0c1c736485e102e9654cde1145 (patch)
treeec4602e8074c0cff4f85f5beb347c33a624234a7 /net/core
parent456ad75c89cdb72e11dcdb6b0794802a6f50c8a3 (diff)
[NET]: merge dev_unicast_discard and dev_mc_discard into one
this two functions could share the dev->_xmit_lock acquired context. Signed-off-by: Denis Cheng <crquan@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/dev.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index 3ba63aaa300..17c9cbd77eb 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2777,23 +2777,16 @@ int dev_unicast_add(struct net_device *dev, void *addr, int alen)
}
EXPORT_SYMBOL(dev_unicast_add);
-static void dev_unicast_discard(struct net_device *dev)
+static void dev_addr_discard(struct net_device *dev)
{
netif_tx_lock_bh(dev);
+
__dev_addr_discard(&dev->uc_list);
dev->uc_count = 0;
- netif_tx_unlock_bh(dev);
-}
-/*
- * Discard multicast list when a device is downed
- */
-
-static void dev_mc_discard(struct net_device *dev)
-{
- netif_tx_lock_bh(dev);
__dev_addr_discard(&dev->mc_list);
dev->mc_count = 0;
+
netif_tx_unlock_bh(dev);
}
@@ -3751,8 +3744,7 @@ void unregister_netdevice(struct net_device *dev)
/*
* Flush the unicast and multicast chains
*/
- dev_unicast_discard(dev);
- dev_mc_discard(dev);
+ dev_addr_discard(dev);
if (dev->uninit)
dev->uninit(dev);