Lines Matching full: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()
220 * @iface: the associated interface entry
227 * interface entry specified by @iface. On success zero is returned, otherwise
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()
260 * @iface: the associated interface entry
267 * interface entry specified by @iface. On success zero is returned, otherwise
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()
456 * @iface: interface entry
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()
518 * @iface: interface entry
529 struct netlbl_unlhsh_iface *iface, in netlbl_unlhsh_remove_addr6() argument
542 list_entry = netlbl_af6list_remove(addr, mask, &iface->addr6_list); in netlbl_unlhsh_remove_addr6()
552 dev = dev_get_by_index(net, iface->ifindex); in netlbl_unlhsh_remove_addr6()
578 * @iface: the interface entry
586 static void netlbl_unlhsh_condremove_iface(struct netlbl_unlhsh_iface *iface) in netlbl_unlhsh_condremove_iface() argument
594 netlbl_af4list_foreach_rcu(iter4, &iface->addr4_list) in netlbl_unlhsh_condremove_iface()
597 netlbl_af6list_foreach_rcu(iter6, &iface->addr6_list) in netlbl_unlhsh_condremove_iface()
600 iface->valid = 0; in netlbl_unlhsh_condremove_iface()
601 if (iface->ifindex > 0) in netlbl_unlhsh_condremove_iface()
602 list_del_rcu(&iface->list); in netlbl_unlhsh_condremove_iface()
607 call_rcu(&iface->rcu, netlbl_unlhsh_free_iface); in netlbl_unlhsh_condremove_iface()
637 struct netlbl_unlhsh_iface *iface; in netlbl_unlhsh_remove() local
650 iface = netlbl_unlhsh_search_iface(dev->ifindex); in netlbl_unlhsh_remove()
652 iface = rcu_dereference(netlbl_unlhsh_def); in netlbl_unlhsh_remove()
653 if (iface == NULL) { in netlbl_unlhsh_remove()
660 iface, addr, mask, in netlbl_unlhsh_remove()
666 iface, addr, mask, in netlbl_unlhsh_remove()
674 netlbl_unlhsh_condremove_iface(iface); in netlbl_unlhsh_remove()
703 struct netlbl_unlhsh_iface *iface = NULL; in netlbl_unlhsh_netdev_handler() local
711 iface = netlbl_unlhsh_search_iface(dev->ifindex); in netlbl_unlhsh_netdev_handler()
712 if (iface != NULL && iface->valid) { in netlbl_unlhsh_netdev_handler()
713 iface->valid = 0; in netlbl_unlhsh_netdev_handler()
714 list_del_rcu(&iface->list); in netlbl_unlhsh_netdev_handler()
716 iface = NULL; in netlbl_unlhsh_netdev_handler()
720 if (iface != NULL) in netlbl_unlhsh_netdev_handler()
721 call_rcu(&iface->rcu, netlbl_unlhsh_free_iface); in netlbl_unlhsh_netdev_handler()
1052 * @iface: the interface entry
1066 const struct netlbl_unlhsh_iface *iface, in netlbl_unlabel_staticlist_gen() argument
1085 if (iface->ifindex > 0) { in netlbl_unlabel_staticlist_gen()
1086 dev = dev_get_by_index(&init_net, iface->ifindex); in netlbl_unlabel_staticlist_gen()
1171 struct netlbl_unlhsh_iface *iface; in netlbl_unlabel_staticlist() local
1188 list_for_each_entry_rcu(iface, iter_list, list) { in netlbl_unlabel_staticlist()
1189 if (!iface->valid || in netlbl_unlabel_staticlist()
1193 &iface->addr4_list) { in netlbl_unlabel_staticlist()
1198 iface, in netlbl_unlabel_staticlist()
1211 &iface->addr6_list) { in netlbl_unlabel_staticlist()
1216 iface, in netlbl_unlabel_staticlist()
1257 struct netlbl_unlhsh_iface *iface; in netlbl_unlabel_staticlistdef() local
1269 iface = rcu_dereference(netlbl_unlhsh_def); in netlbl_unlabel_staticlistdef()
1270 if (iface == NULL || !iface->valid) in netlbl_unlabel_staticlistdef()
1273 netlbl_af4list_foreach_rcu(addr4, &iface->addr4_list) { in netlbl_unlabel_staticlistdef()
1277 iface, in netlbl_unlabel_staticlistdef()
1286 netlbl_af6list_foreach_rcu(addr6, &iface->addr6_list) { in netlbl_unlabel_staticlistdef()
1290 iface, in netlbl_unlabel_staticlistdef()
1463 struct netlbl_unlhsh_iface *iface; in netlbl_unlabel_getattr() local
1466 iface = netlbl_unlhsh_search_iface(skb->skb_iif); in netlbl_unlabel_getattr()
1467 if (iface == NULL) in netlbl_unlabel_getattr()
1468 iface = rcu_dereference(netlbl_unlhsh_def); in netlbl_unlabel_getattr()
1469 if (iface == NULL || !iface->valid) in netlbl_unlabel_getattr()
1488 &iface->addr4_list); in netlbl_unlabel_getattr()
1501 &iface->addr6_list); in netlbl_unlabel_getattr()