@@ -163,6 +163,7 @@ struct inet6_dev
struct inet6_ifaddr *addr_list;
struct ifmcaddr6 *mc_list;
+ int mc_count; /* Number of installed mcasts */
struct ifmcaddr6 *mc_tomb;
rwlock_t mc_lock;
unsigned char mc_qrv;
@@ -922,6 +922,7 @@ int ipv6_dev_mc_inc(struct net_device *dev, const struct in6_addr *addr)
mc->next = idev->mc_list;
idev->mc_list = mc;
+ mc->idev->mc_count++;
write_unlock_bh(&idev->lock);
mld_del_delrec(idev, &mc->mca_addr);
@@ -943,7 +944,7 @@ int __ipv6_dev_mc_dec(struct inet6_dev *idev, const struct in6_addr *addr)
if (--ma->mca_users == 0) {
*map = ma->next;
write_unlock_bh(&idev->lock);
-
+ idev->mc_count--;
igmp6_group_dropped(ma);
ma_put(ma);
@@ -2288,6 +2289,7 @@ void ipv6_mc_init_dev(struct inet6_dev *idev)
(unsigned long)idev);
idev->mc_tomb = NULL;
idev->mc_ifc_count = 0;
+ idev->mc_count=0;
setup_timer(&idev->mc_ifc_timer, mld_ifc_timer_expire,
(unsigned long)idev);
idev->mc_qrv = MLD_QRV_DEFAULT;