Lines Matching refs:mc_lst
137 struct ipv6_mc_socklist *mc_lst; in __ipv6_sock_mc_join() local
148 for_each_pmc_rcu(np, mc_lst) { in __ipv6_sock_mc_join()
149 if ((ifindex == 0 || mc_lst->ifindex == ifindex) && in __ipv6_sock_mc_join()
150 ipv6_addr_equal(&mc_lst->addr, addr)) { in __ipv6_sock_mc_join()
157 mc_lst = sock_kmalloc(sk, sizeof(struct ipv6_mc_socklist), GFP_KERNEL); in __ipv6_sock_mc_join()
159 if (!mc_lst) in __ipv6_sock_mc_join()
162 mc_lst->next = NULL; in __ipv6_sock_mc_join()
163 mc_lst->addr = *addr; in __ipv6_sock_mc_join()
176 sock_kfree_s(sk, mc_lst, sizeof(*mc_lst)); in __ipv6_sock_mc_join()
180 mc_lst->ifindex = dev->ifindex; in __ipv6_sock_mc_join()
181 mc_lst->sfmode = mode; in __ipv6_sock_mc_join()
182 rwlock_init(&mc_lst->sflock); in __ipv6_sock_mc_join()
183 mc_lst->sflist = NULL; in __ipv6_sock_mc_join()
192 sock_kfree_s(sk, mc_lst, sizeof(*mc_lst)); in __ipv6_sock_mc_join()
196 mc_lst->next = np->ipv6_mc_list; in __ipv6_sock_mc_join()
197 rcu_assign_pointer(np->ipv6_mc_list, mc_lst); in __ipv6_sock_mc_join()
220 struct ipv6_mc_socklist *mc_lst; in ipv6_sock_mc_drop() local
230 (mc_lst = rtnl_dereference(*lnk)) != NULL; in ipv6_sock_mc_drop()
231 lnk = &mc_lst->next) { in ipv6_sock_mc_drop()
232 if ((ifindex == 0 || mc_lst->ifindex == ifindex) && in ipv6_sock_mc_drop()
233 ipv6_addr_equal(&mc_lst->addr, addr)) { in ipv6_sock_mc_drop()
236 *lnk = mc_lst->next; in ipv6_sock_mc_drop()
238 dev = __dev_get_by_index(net, mc_lst->ifindex); in ipv6_sock_mc_drop()
242 (void) ip6_mc_leave_src(sk, mc_lst, idev); in ipv6_sock_mc_drop()
244 __ipv6_dev_mc_dec(idev, &mc_lst->addr); in ipv6_sock_mc_drop()
246 (void) ip6_mc_leave_src(sk, mc_lst, NULL); in ipv6_sock_mc_drop()
248 atomic_sub(sizeof(*mc_lst), &sk->sk_omem_alloc); in ipv6_sock_mc_drop()
249 kfree_rcu(mc_lst, rcu); in ipv6_sock_mc_drop()
292 struct ipv6_mc_socklist *mc_lst; in __ipv6_sock_mc_close() local
297 while ((mc_lst = rtnl_dereference(np->ipv6_mc_list)) != NULL) { in __ipv6_sock_mc_close()
300 np->ipv6_mc_list = mc_lst->next; in __ipv6_sock_mc_close()
302 dev = __dev_get_by_index(net, mc_lst->ifindex); in __ipv6_sock_mc_close()
306 (void) ip6_mc_leave_src(sk, mc_lst, idev); in __ipv6_sock_mc_close()
308 __ipv6_dev_mc_dec(idev, &mc_lst->addr); in __ipv6_sock_mc_close()
310 (void) ip6_mc_leave_src(sk, mc_lst, NULL); in __ipv6_sock_mc_close()
312 atomic_sub(sizeof(*mc_lst), &sk->sk_omem_alloc); in __ipv6_sock_mc_close()
313 kfree_rcu(mc_lst, rcu); in __ipv6_sock_mc_close()