diff --git a/include/net/if_inet6.h b/include/net/if_inet6.h index c8effa4..9e9139c 100644 --- a/include/net/if_inet6.h +++ b/include/net/if_inet6.h @@ -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; diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c index e7c03bc..835521d 100644 --- a/net/ipv6/mcast.c +++ b/net/ipv6/mcast.c @@ -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;