Lines Matching refs:iface

149 	struct netlbl_unlhsh_iface *iface;  in netlbl_unlhsh_free_iface()  local
157 iface = container_of(entry, struct netlbl_unlhsh_iface, rcu); in netlbl_unlhsh_free_iface()
162 netlbl_af4list_foreach_safe(iter4, tmp4, &iface->addr4_list) { in netlbl_unlhsh_free_iface()
167 netlbl_af6list_foreach_safe(iter6, tmp6, &iface->addr6_list) { in netlbl_unlhsh_free_iface()
172 kfree(iface); in netlbl_unlhsh_free_iface()
231 static int netlbl_unlhsh_add_addr4(struct netlbl_unlhsh_iface *iface, in netlbl_unlhsh_add_addr4() argument
249 ret_val = netlbl_af4list_add(&entry->list, &iface->addr4_list); in netlbl_unlhsh_add_addr4()
271 static int netlbl_unlhsh_add_addr6(struct netlbl_unlhsh_iface *iface, in netlbl_unlhsh_add_addr6() argument
293 ret_val = netlbl_af6list_add(&entry->list, &iface->addr6_list); in netlbl_unlhsh_add_addr6()
315 struct netlbl_unlhsh_iface *iface; in netlbl_unlhsh_add_iface() local
317 iface = kzalloc(sizeof(*iface), GFP_ATOMIC); in netlbl_unlhsh_add_iface()
318 if (iface == NULL) in netlbl_unlhsh_add_iface()
321 iface->ifindex = ifindex; in netlbl_unlhsh_add_iface()
322 INIT_LIST_HEAD(&iface->addr4_list); in netlbl_unlhsh_add_iface()
323 INIT_LIST_HEAD(&iface->addr6_list); in netlbl_unlhsh_add_iface()
324 iface->valid = 1; in netlbl_unlhsh_add_iface()
331 list_add_tail_rcu(&iface->list, in netlbl_unlhsh_add_iface()
334 INIT_LIST_HEAD(&iface->list); in netlbl_unlhsh_add_iface()
337 rcu_assign_pointer(netlbl_unlhsh_def, iface); in netlbl_unlhsh_add_iface()
341 return iface; in netlbl_unlhsh_add_iface()
345 kfree(iface); in netlbl_unlhsh_add_iface()
375 struct netlbl_unlhsh_iface *iface; in netlbl_unlhsh_add() local
392 iface = netlbl_unlhsh_search_iface(ifindex); in netlbl_unlhsh_add()
395 iface = rcu_dereference(netlbl_unlhsh_def); in netlbl_unlhsh_add()
397 if (iface == NULL) { in netlbl_unlhsh_add()
398 iface = netlbl_unlhsh_add_iface(ifindex); in netlbl_unlhsh_add()
399 if (iface == NULL) { in netlbl_unlhsh_add()
411 ret_val = netlbl_unlhsh_add_addr4(iface, addr4, mask4, secid); in netlbl_unlhsh_add()
424 ret_val = netlbl_unlhsh_add_addr6(iface, addr6, mask6, secid); in netlbl_unlhsh_add()
467 struct netlbl_unlhsh_iface *iface, in netlbl_unlhsh_remove_addr4() argument
481 &iface->addr4_list); in netlbl_unlhsh_remove_addr4()
491 dev = dev_get_by_index(net, iface->ifindex); in netlbl_unlhsh_remove_addr4()
528 struct netlbl_unlhsh_iface *iface, in netlbl_unlhsh_remove_addr6() argument
541 list_entry = netlbl_af6list_remove(addr, mask, &iface->addr6_list); in netlbl_unlhsh_remove_addr6()
551 dev = dev_get_by_index(net, iface->ifindex); in netlbl_unlhsh_remove_addr6()
584 static void netlbl_unlhsh_condremove_iface(struct netlbl_unlhsh_iface *iface) in netlbl_unlhsh_condremove_iface() argument
592 netlbl_af4list_foreach_rcu(iter4, &iface->addr4_list) in netlbl_unlhsh_condremove_iface()
595 netlbl_af6list_foreach_rcu(iter6, &iface->addr6_list) in netlbl_unlhsh_condremove_iface()
598 iface->valid = 0; in netlbl_unlhsh_condremove_iface()
599 if (iface->ifindex > 0) in netlbl_unlhsh_condremove_iface()
600 list_del_rcu(&iface->list); in netlbl_unlhsh_condremove_iface()
605 call_rcu(&iface->rcu, netlbl_unlhsh_free_iface); in netlbl_unlhsh_condremove_iface()
635 struct netlbl_unlhsh_iface *iface; in netlbl_unlhsh_remove() local
648 iface = netlbl_unlhsh_search_iface(dev->ifindex); in netlbl_unlhsh_remove()
650 iface = rcu_dereference(netlbl_unlhsh_def); in netlbl_unlhsh_remove()
651 if (iface == NULL) { in netlbl_unlhsh_remove()
658 iface, addr, mask, in netlbl_unlhsh_remove()
664 iface, addr, mask, in netlbl_unlhsh_remove()
672 netlbl_unlhsh_condremove_iface(iface); in netlbl_unlhsh_remove()
701 struct netlbl_unlhsh_iface *iface = NULL; in netlbl_unlhsh_netdev_handler() local
709 iface = netlbl_unlhsh_search_iface(dev->ifindex); in netlbl_unlhsh_netdev_handler()
710 if (iface != NULL && iface->valid) { in netlbl_unlhsh_netdev_handler()
711 iface->valid = 0; in netlbl_unlhsh_netdev_handler()
712 list_del_rcu(&iface->list); in netlbl_unlhsh_netdev_handler()
714 iface = NULL; in netlbl_unlhsh_netdev_handler()
718 if (iface != NULL) in netlbl_unlhsh_netdev_handler()
719 call_rcu(&iface->rcu, netlbl_unlhsh_free_iface); in netlbl_unlhsh_netdev_handler()
1064 const struct netlbl_unlhsh_iface *iface, in netlbl_unlabel_staticlist_gen() argument
1083 if (iface->ifindex > 0) { in netlbl_unlabel_staticlist_gen()
1084 dev = dev_get_by_index(&init_net, iface->ifindex); in netlbl_unlabel_staticlist_gen()
1169 struct netlbl_unlhsh_iface *iface; in netlbl_unlabel_staticlist() local
1186 list_for_each_entry_rcu(iface, iter_list, list) { in netlbl_unlabel_staticlist()
1187 if (!iface->valid || in netlbl_unlabel_staticlist()
1191 &iface->addr4_list) { in netlbl_unlabel_staticlist()
1196 iface, in netlbl_unlabel_staticlist()
1209 &iface->addr6_list) { in netlbl_unlabel_staticlist()
1214 iface, in netlbl_unlabel_staticlist()
1255 struct netlbl_unlhsh_iface *iface; in netlbl_unlabel_staticlistdef() local
1267 iface = rcu_dereference(netlbl_unlhsh_def); in netlbl_unlabel_staticlistdef()
1268 if (iface == NULL || !iface->valid) in netlbl_unlabel_staticlistdef()
1271 netlbl_af4list_foreach_rcu(addr4, &iface->addr4_list) { in netlbl_unlabel_staticlistdef()
1275 iface, in netlbl_unlabel_staticlistdef()
1284 netlbl_af6list_foreach_rcu(addr6, &iface->addr6_list) { in netlbl_unlabel_staticlistdef()
1288 iface, in netlbl_unlabel_staticlistdef()
1461 struct netlbl_unlhsh_iface *iface; in netlbl_unlabel_getattr() local
1464 iface = netlbl_unlhsh_search_iface(skb->skb_iif); in netlbl_unlabel_getattr()
1465 if (iface == NULL) in netlbl_unlabel_getattr()
1466 iface = rcu_dereference(netlbl_unlhsh_def); in netlbl_unlabel_getattr()
1467 if (iface == NULL || !iface->valid) in netlbl_unlabel_getattr()
1486 &iface->addr4_list); in netlbl_unlabel_getattr()
1499 &iface->addr6_list); in netlbl_unlabel_getattr()