aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/dev_mcast.c
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2007-06-30 16:35:52 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-07-11 01:16:23 -0400
commit61cbc2fca6335be52788773b21efdc52a2750924 (patch)
tree489e6a9571c7fabd49dcff384dd634635fe66555 /net/core/dev_mcast.c
parentd62733c8e437fdb58325617c4b3331769ba82d70 (diff)
[NET]: Fix secondary unicast/multicast address count maintenance
When a reference to an existing address is increased or decreased without hitting zero, the address count is incorrectly adjusted. 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.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/net/core/dev_mcast.c b/net/core/dev_mcast.c
index 5cc9b448c44..aa38100601f 100644
--- a/net/core/dev_mcast.c
+++ b/net/core/dev_mcast.c
@@ -72,10 +72,9 @@ int dev_mc_delete(struct net_device *dev, void *addr, int alen, int glbl)
72 int err; 72 int err;
73 73
74 netif_tx_lock_bh(dev); 74 netif_tx_lock_bh(dev);
75 err = __dev_addr_delete(&dev->mc_list, addr, alen, glbl); 75 err = __dev_addr_delete(&dev->mc_list, &dev->mc_count,
76 addr, alen, glbl);
76 if (!err) { 77 if (!err) {
77 dev->mc_count--;
78
79 /* 78 /*
80 * We have altered the list, so the card 79 * We have altered the list, so the card
81 * loaded filter is now wrong. Fix it 80 * loaded filter is now wrong. Fix it
@@ -96,11 +95,9 @@ int dev_mc_add(struct net_device *dev, void *addr, int alen, int glbl)
96 int err; 95 int err;
97 96
98 netif_tx_lock_bh(dev); 97 netif_tx_lock_bh(dev);
99 err = __dev_addr_add(&dev->mc_list, addr, alen, glbl); 98 err = __dev_addr_add(&dev->mc_list, &dev->mc_count, addr, alen, glbl);
100 if (!err) { 99 if (!err)
101 dev->mc_count++;
102 __dev_set_rx_mode(dev); 100 __dev_set_rx_mode(dev);
103 }
104 netif_tx_unlock_bh(dev); 101 netif_tx_unlock_bh(dev);
105 return err; 102 return err;
106} 103}