void ip_mc_inc_group(struct in_device *in_dev, u32 addr) { struct ip_mc_list *i, *im; im = (struct ip_mc_list *)kmalloc(sizeof(*im), GFP_KERNEL); for (i=in_dev->mc_list; i; i=i->next) { if (i->multiaddr == addr) { i->users++; if (im) kfree(im); return; } } if (!im) return; im->users=1; im->interface=in_dev; im->multiaddr=addr; #ifdef CONFIG_IP_MULTICAST im->tm_running=0; init_timer(&im->timer); im->timer.data=(unsigned long)im; im->timer.function=&igmp_timer_expire; im->unsolicit_count = IGMP_Unsolicited_Report_Count; im->reporter = 0; im->loaded = 0; #endif im->next=in_dev->mc_list; in_dev->mc_list=im; igmp_group_added(im); if (in_dev->dev->flags & IFF_UP) ip_rt_multicast_event(in_dev); return; }
void ip_mc_up(struct in_device *in_dev) { struct ip_mc_list *i; ip_mc_inc_group(in_dev, IGMP_ALL_HOSTS); for (i=in_dev->mc_list; i; i=i->next) igmp_group_added(i); }
void ip_mc_up(struct in_device *in_dev) { struct ip_mc_list *i; ASSERT_RTNL(); ip_mc_inc_group(in_dev, IGMP_ALL_HOSTS); for (i=in_dev->mc_list; i; i=i->next) igmp_group_added(i); #ifdef CONFIG_RG_IGMP_PROXY igmprx_if_up(in_dev); #endif #ifdef CONFIG_RG_IGMP_PROXY_MODULE if (igmp_proxy_if_up) igmp_proxy_if_up(in_dev); #endif }
void ip_mc_inc_group(struct in_device *in_dev, u32 addr) { struct ip_mc_list *im; ASSERT_RTNL(); for (im=in_dev->mc_list; im; im=im->next) { if (im->multiaddr == addr) { im->users++; goto out; } } im = (struct ip_mc_list *)kmalloc(sizeof(*im), GFP_KERNEL); if (!im) goto out; im->users=1; im->interface=in_dev; in_dev_hold(in_dev); im->multiaddr=addr; atomic_set(&im->refcnt, 1); spin_lock_init(&im->lock); #ifdef CONFIG_IP_MULTICAST im->tm_running=0; init_timer(&im->timer); im->timer.data=(unsigned long)im; im->timer.function=&igmp_timer_expire; im->unsolicit_count = IGMP_Unsolicited_Report_Count; im->reporter = 0; #endif im->loaded = 0; write_lock_bh(&in_dev->lock); im->next=in_dev->mc_list; in_dev->mc_list=im; write_unlock_bh(&in_dev->lock); igmp_group_added(im); if (in_dev->dev->flags & IFF_UP) ip_rt_multicast_event(in_dev); out: return; }
static void ip_mc_inc_group(struct device *dev, unsigned long addr) { struct ip_mc_list *i; for(i=dev->ip_mc_list;i!=NULL;i=i->next) { if(i->multiaddr==addr) { i->users++; return; } } i=(struct ip_mc_list *)kmalloc(sizeof(*i), GFP_KERNEL); if(!i) return; i->users=1; i->interface=dev; i->multiaddr=addr; i->next=dev->ip_mc_list; igmp_group_added(i); dev->ip_mc_list=i; }