Lines Matching refs:aca
224 static void ipv6_add_acaddr_hash(struct net *net, struct ifacaddr6 *aca) in ipv6_add_acaddr_hash() argument
226 unsigned int hash = inet6_acaddr_hash(net, &aca->aca_addr); in ipv6_add_acaddr_hash()
229 hlist_add_head_rcu(&aca->aca_addr_lst, &inet6_acaddr_lst[hash]); in ipv6_add_acaddr_hash()
233 static void ipv6_del_acaddr_hash(struct ifacaddr6 *aca) in ipv6_del_acaddr_hash() argument
236 hlist_del_init_rcu(&aca->aca_addr_lst); in ipv6_del_acaddr_hash()
240 static void aca_get(struct ifacaddr6 *aca) in aca_get() argument
242 refcount_inc(&aca->aca_refcnt); in aca_get()
247 struct ifacaddr6 *aca = container_of(h, struct ifacaddr6, rcu); in aca_free_rcu() local
249 fib6_info_release(aca->aca_rt); in aca_free_rcu()
250 kfree(aca); in aca_free_rcu()
263 struct ifacaddr6 *aca; in aca_alloc() local
265 aca = kzalloc(sizeof(*aca), GFP_ATOMIC); in aca_alloc()
266 if (!aca) in aca_alloc()
269 aca->aca_addr = *addr; in aca_alloc()
271 aca->aca_rt = f6i; in aca_alloc()
272 INIT_HLIST_NODE(&aca->aca_addr_lst); in aca_alloc()
273 aca->aca_users = 1; in aca_alloc()
275 aca->aca_cstamp = aca->aca_tstamp = jiffies; in aca_alloc()
276 refcount_set(&aca->aca_refcnt, 1); in aca_alloc()
278 return aca; in aca_alloc()
286 struct ifacaddr6 *aca; in __ipv6_dev_ac_inc() local
299 for (aca = idev->ac_list; aca; aca = aca->aca_next) { in __ipv6_dev_ac_inc()
300 if (ipv6_addr_equal(&aca->aca_addr, addr)) { in __ipv6_dev_ac_inc()
301 aca->aca_users++; in __ipv6_dev_ac_inc()
313 aca = aca_alloc(f6i, addr); in __ipv6_dev_ac_inc()
314 if (!aca) { in __ipv6_dev_ac_inc()
320 aca->aca_next = idev->ac_list; in __ipv6_dev_ac_inc()
321 idev->ac_list = aca; in __ipv6_dev_ac_inc()
326 aca_get(aca); in __ipv6_dev_ac_inc()
329 ipv6_add_acaddr_hash(net, aca); in __ipv6_dev_ac_inc()
333 addrconf_join_solict(idev->dev, &aca->aca_addr); in __ipv6_dev_ac_inc()
335 aca_put(aca); in __ipv6_dev_ac_inc()
347 struct ifacaddr6 *aca, *prev_aca; in __ipv6_dev_ac_dec() local
353 for (aca = idev->ac_list; aca; aca = aca->aca_next) { in __ipv6_dev_ac_dec()
354 if (ipv6_addr_equal(&aca->aca_addr, addr)) in __ipv6_dev_ac_dec()
356 prev_aca = aca; in __ipv6_dev_ac_dec()
358 if (!aca) { in __ipv6_dev_ac_dec()
362 if (--aca->aca_users > 0) { in __ipv6_dev_ac_dec()
367 prev_aca->aca_next = aca->aca_next; in __ipv6_dev_ac_dec()
369 idev->ac_list = aca->aca_next; in __ipv6_dev_ac_dec()
371 ipv6_del_acaddr_hash(aca); in __ipv6_dev_ac_dec()
372 addrconf_leave_solict(idev, &aca->aca_addr); in __ipv6_dev_ac_dec()
374 ip6_del_rt(dev_net(idev->dev), aca->aca_rt, false); in __ipv6_dev_ac_dec()
376 aca_put(aca); in __ipv6_dev_ac_dec()
392 struct ifacaddr6 *aca; in ipv6_ac_destroy_dev() local
395 while ((aca = idev->ac_list) != NULL) { in ipv6_ac_destroy_dev()
396 idev->ac_list = aca->aca_next; in ipv6_ac_destroy_dev()
399 ipv6_del_acaddr_hash(aca); in ipv6_ac_destroy_dev()
401 addrconf_leave_solict(idev, &aca->aca_addr); in ipv6_ac_destroy_dev()
403 ip6_del_rt(dev_net(idev->dev), aca->aca_rt, false); in ipv6_ac_destroy_dev()
405 aca_put(aca); in ipv6_ac_destroy_dev()
419 struct ifacaddr6 *aca; in ipv6_chk_acast_dev() local
424 for (aca = idev->ac_list; aca; aca = aca->aca_next) in ipv6_chk_acast_dev()
425 if (ipv6_addr_equal(&aca->aca_addr, addr)) in ipv6_chk_acast_dev()
428 return aca != NULL; in ipv6_chk_acast_dev()
440 struct ifacaddr6 *aca; in ipv6_chk_acast_addr() local
449 hlist_for_each_entry_rcu(aca, &inet6_acaddr_lst[hash], in ipv6_chk_acast_addr()
451 nh_dev = fib6_info_nh_dev(aca->aca_rt); in ipv6_chk_acast_addr()
454 if (ipv6_addr_equal(&aca->aca_addr, addr)) { in ipv6_chk_acast_addr()