extern int dev_mc_delete(struct net_device *dev, void *addr, int alen, int all);
extern int dev_mc_add(struct net_device *dev, void *addr, int alen, int newonly);
extern void dev_mc_discard(struct net_device *dev);
-extern int __dev_addr_delete(struct dev_addr_list **list, void *addr, int alen, int all);
-extern int __dev_addr_add(struct dev_addr_list **list, void *addr, int alen, int newonly);
+extern int __dev_addr_delete(struct dev_addr_list **list, int *count, void *addr, int alen, int all);
+extern int __dev_addr_add(struct dev_addr_list **list, int *count, void *addr, int alen, int newonly);
extern void __dev_addr_discard(struct dev_addr_list **list);
extern void dev_set_promiscuity(struct net_device *dev, int inc);
extern void dev_set_allmulti(struct net_device *dev, int inc);
netif_tx_unlock_bh(dev);
}
-int __dev_addr_delete(struct dev_addr_list **list, void *addr, int alen,
- int glbl)
+int __dev_addr_delete(struct dev_addr_list **list, int *count,
+ void *addr, int alen, int glbl)
{
struct dev_addr_list *da;
*list = da->next;
kfree(da);
+ (*count)--;
return 0;
}
}
return -ENOENT;
}
-int __dev_addr_add(struct dev_addr_list **list, void *addr, int alen, int glbl)
+int __dev_addr_add(struct dev_addr_list **list, int *count,
+ void *addr, int alen, int glbl)
{
struct dev_addr_list *da;
da->da_gusers = glbl ? 1 : 0;
da->next = *list;
*list = da;
+ (*count)++;
return 0;
}
ASSERT_RTNL();
netif_tx_lock_bh(dev);
- err = __dev_addr_delete(&dev->uc_list, addr, alen, 0);
- if (!err) {
- dev->uc_count--;
+ err = __dev_addr_delete(&dev->uc_list, &dev->uc_count, addr, alen, 0);
+ if (!err)
__dev_set_rx_mode(dev);
- }
netif_tx_unlock_bh(dev);
return err;
}
ASSERT_RTNL();
netif_tx_lock_bh(dev);
- err = __dev_addr_add(&dev->uc_list, addr, alen, 0);
- if (!err) {
- dev->uc_count++;
+ err = __dev_addr_add(&dev->uc_list, &dev->uc_count, addr, alen, 0);
+ if (!err)
__dev_set_rx_mode(dev);
- }
netif_tx_unlock_bh(dev);
return err;
}
int err;
netif_tx_lock_bh(dev);
- err = __dev_addr_delete(&dev->mc_list, addr, alen, glbl);
+ err = __dev_addr_delete(&dev->mc_list, &dev->mc_count,
+ addr, alen, glbl);
if (!err) {
- dev->mc_count--;
-
/*
* We have altered the list, so the card
* loaded filter is now wrong. Fix it
int err;
netif_tx_lock_bh(dev);
- err = __dev_addr_add(&dev->mc_list, addr, alen, glbl);
- if (!err) {
- dev->mc_count++;
+ err = __dev_addr_add(&dev->mc_list, &dev->mc_count, addr, alen, glbl);
+ if (!err)
__dev_set_rx_mode(dev);
- }
netif_tx_unlock_bh(dev);
return err;
}