aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/dev_mcast.c
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2007-06-27 04:28:10 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-07-11 01:15:56 -0400
commit4417da668c0021903464f92db278ddae348e0299 (patch)
treea4330cbc2e69a5714fee0a04bcfbabe97109de46 /net/core/dev_mcast.c
parent3fba5a8b1e3df2384b90493538161e83cf15dd5f (diff)
[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>
Diffstat (limited to 'net/core/dev_mcast.c')
-rw-r--r--net/core/dev_mcast.c37
1 files changed, 2 insertions, 35 deletions
diff --git a/net/core/dev_mcast.c b/net/core/dev_mcast.c
index 702907434a47..5cc9b448c443 100644
--- a/net/core/dev_mcast.c
+++ b/net/core/dev_mcast.c
@@ -64,39 +64,6 @@
64 */ 64 */
65 65
66/* 66/*
67 * Update the multicast list into the physical NIC controller.
68 */
69
70static void __dev_mc_upload(struct net_device *dev)
71{
72 /* Don't do anything till we up the interface
73 * [dev_open will call this function so the list will
74 * stay sane]
75 */
76
77 if (!(dev->flags&IFF_UP))
78 return;
79
80 /*
81 * Devices with no set multicast or which have been
82 * detached don't get set.
83 */
84
85 if (dev->set_multicast_list == NULL ||
86 !netif_device_present(dev))
87 return;
88
89 dev->set_multicast_list(dev);
90}
91
92void dev_mc_upload(struct net_device *dev)
93{
94 netif_tx_lock_bh(dev);
95 __dev_mc_upload(dev);
96 netif_tx_unlock_bh(dev);
97}
98
99/*
100 * Delete a device level multicast 67 * Delete a device level multicast
101 */ 68 */
102 69
@@ -114,7 +81,7 @@ int dev_mc_delete(struct net_device *dev, void *addr, int alen, int glbl)
114 * loaded filter is now wrong. Fix it 81 * loaded filter is now wrong. Fix it
115 */ 82 */
116 83
117 __dev_mc_upload(dev); 84 __dev_set_rx_mode(dev);
118 } 85 }
119 netif_tx_unlock_bh(dev); 86 netif_tx_unlock_bh(dev);
120 return err; 87 return err;
@@ -132,7 +99,7 @@ int dev_mc_add(struct net_device *dev, void *addr, int alen, int glbl)
132 err = __dev_addr_add(&dev->mc_list, addr, alen, glbl); 99 err = __dev_addr_add(&dev->mc_list, addr, alen, glbl);
133 if (!err) { 100 if (!err) {
134 dev->mc_count++; 101 dev->mc_count++;
135 __dev_mc_upload(dev); 102 __dev_set_rx_mode(dev);
136 } 103 }
137 netif_tx_unlock_bh(dev); 104 netif_tx_unlock_bh(dev);
138 return err; 105 return err;