Lines Matching refs:ao_info

83 		ao = rcu_dereference(tcp_twsk(sk)->ao_info);  in tcp_ao_ignore_icmp()
95 ao = rcu_dereference(tcp_sk(sk)->ao_info); in tcp_ao_ignore_icmp()
203 ao = rcu_dereference_check(tcp_sk(sk)->ao_info, in __tcp_ao_do_lookup()
300 ao = rcu_dereference_protected(tcp_twsk(sk)->ao_info, 1); in tcp_ao_destroy_sock()
301 rcu_assign_pointer(tcp_twsk(sk)->ao_info, NULL); in tcp_ao_destroy_sock()
303 ao = rcu_dereference_protected(tcp_sk(sk)->ao_info, 1); in tcp_ao_destroy_sock()
304 rcu_assign_pointer(tcp_sk(sk)->ao_info, NULL); in tcp_ao_destroy_sock()
317 struct tcp_ao_info *ao_info = rcu_dereference_protected(tp->ao_info, 1); in tcp_ao_time_wait() local
319 if (ao_info) { in tcp_ao_time_wait()
324 hlist_for_each_entry_safe(key, n, &ao_info->head, node) { in tcp_ao_time_wait()
328 refcount_inc(&ao_info->refcnt); in tcp_ao_time_wait()
330 rcu_assign_pointer(tcptw->ao_info, ao_info); in tcp_ao_time_wait()
332 tcptw->ao_info = NULL; in tcp_ao_time_wait()
729 struct tcp_ao_info *ao_info; in tcp_ao_prepare_reset() local
767 ao_info = rcu_dereference(tcp_sk(sk)->ao_info); in tcp_ao_prepare_reset()
768 if (!ao_info) in tcp_ao_prepare_reset()
787 ao_info = rcu_dereference(tcp_twsk(sk)->ao_info); in tcp_ao_prepare_reset()
790 ao_info = rcu_dereference(tcp_sk(sk)->ao_info); in tcp_ao_prepare_reset()
793 if (!ao_info) in tcp_ao_prepare_reset()
796 *key = tcp_ao_established_key(ao_info, aoh->rnext_keyid, -1); in tcp_ao_prepare_reset()
800 rnext_key = READ_ONCE(ao_info->rnext_key); in tcp_ao_prepare_reset()
802 *sne = tcp_ao_compute_sne(READ_ONCE(ao_info->snd_sne), in tcp_ao_prepare_reset()
819 ao = rcu_dereference_protected(tcp_sk(sk)->ao_info, in tcp_ao_transmit_skb()
957 info = rcu_dereference(tcp_sk(sk)->ao_info); in tcp_inbound_ao_hash()
1096 struct tcp_ao_info *ao_info; in tcp_ao_connect_init() local
1102 ao_info = rcu_dereference_protected(tp->ao_info, in tcp_ao_connect_init()
1104 if (!ao_info) in tcp_ao_connect_init()
1120 hlist_for_each_entry_safe(key, next, &ao_info->head, node) { in tcp_ao_connect_init()
1124 if (key == ao_info->current_key) in tcp_ao_connect_init()
1125 ao_info->current_key = NULL; in tcp_ao_connect_init()
1126 if (key == ao_info->rnext_key) in tcp_ao_connect_init()
1127 ao_info->rnext_key = NULL; in tcp_ao_connect_init()
1138 if (!ao_info->current_key) in tcp_ao_connect_init()
1139 ao_info->current_key = key; in tcp_ao_connect_init()
1140 if (!ao_info->rnext_key) in tcp_ao_connect_init()
1141 ao_info->rnext_key = key; in tcp_ao_connect_init()
1144 ao_info->lisn = htonl(tp->write_seq); in tcp_ao_connect_init()
1145 ao_info->snd_sne = 0; in tcp_ao_connect_init()
1151 rcu_assign_pointer(tp->ao_info, NULL); in tcp_ao_connect_init()
1152 kfree(ao_info); in tcp_ao_connect_init()
1161 ao = rcu_dereference_protected(tcp_sk(sk)->ao_info, in tcp_ao_established()
1175 ao = rcu_dereference_protected(tcp_sk(sk)->ao_info, in tcp_ao_finish_connect()
1198 ao = rcu_dereference(tcp_sk(sk)->ao_info); in tcp_ao_copy_all_matching()
1273 rcu_assign_pointer(tcp_sk(newsk)->ao_info, new_ao); in tcp_ao_copy_all_matching()
1524 return rcu_dereference_protected(tcp_sk(sk)->ao_info, in setsockopt_ao_info()
1527 return rcu_dereference_protected(tcp_twsk(sk)->ao_info, in setsockopt_ao_info()
1536 return rcu_dereference(tcp_sk(sk)->ao_info); in getsockopt_ao_info()
1538 return rcu_dereference(tcp_twsk(sk)->ao_info); in getsockopt_ao_info()
1598 struct tcp_ao_info *ao_info; in tcp_ao_add_cmd() local
1683 ao_info = setsockopt_ao_info(sk); in tcp_ao_add_cmd()
1684 if (IS_ERR(ao_info)) in tcp_ao_add_cmd()
1685 return PTR_ERR(ao_info); in tcp_ao_add_cmd()
1687 if (!ao_info) { in tcp_ao_add_cmd()
1688 ao_info = tcp_ao_alloc_info(GFP_KERNEL); in tcp_ao_add_cmd()
1689 if (!ao_info) in tcp_ao_add_cmd()
1728 tcp_ao_cache_traffic_keys(sk, ao_info, key); in tcp_ao_add_cmd()
1730 ao_info->current_key = key; in tcp_ao_add_cmd()
1731 ao_info->rnext_key = key; in tcp_ao_add_cmd()
1735 tcp_ao_link_mkt(ao_info, key); in tcp_ao_add_cmd()
1742 rcu_assign_pointer(tcp_sk(sk)->ao_info, ao_info); in tcp_ao_add_cmd()
1746 WRITE_ONCE(ao_info->current_key, key); in tcp_ao_add_cmd()
1748 WRITE_ONCE(ao_info->rnext_key, key); in tcp_ao_add_cmd()
1757 kfree(ao_info); in tcp_ao_add_cmd()
1761 static int tcp_ao_delete_key(struct sock *sk, struct tcp_ao_info *ao_info, in tcp_ao_delete_key() argument
1791 WRITE_ONCE(ao_info->current_key, new_current); in tcp_ao_delete_key()
1793 WRITE_ONCE(ao_info->rnext_key, new_rnext); in tcp_ao_delete_key()
1795 if (unlikely(READ_ONCE(ao_info->current_key) == key || in tcp_ao_delete_key()
1796 READ_ONCE(ao_info->rnext_key) == key)) { in tcp_ao_delete_key()
1806 hlist_add_head_rcu(&key->node, &ao_info->head); in tcp_ao_delete_key()
1816 struct tcp_ao_info *ao_info; in tcp_ao_del_cmd() local
1848 ao_info = setsockopt_ao_info(sk); in tcp_ao_del_cmd()
1849 if (IS_ERR(ao_info)) in tcp_ao_del_cmd()
1850 return PTR_ERR(ao_info); in tcp_ao_del_cmd()
1851 if (!ao_info) in tcp_ao_del_cmd()
1860 new_current = tcp_ao_established_key(ao_info, cmd.current_key, -1); in tcp_ao_del_cmd()
1865 new_rnext = tcp_ao_established_key(ao_info, -1, cmd.rnext); in tcp_ao_del_cmd()
1905 hlist_for_each_entry_rcu(key, &ao_info->head, node) { in tcp_ao_del_cmd()
1925 return tcp_ao_delete_key(sk, ao_info, cmd.del_async, key, in tcp_ao_del_cmd()
1960 struct tcp_ao_info *ao_info; in tcp_ao_info_cmd() local
1980 ao_info = setsockopt_ao_info(sk); in tcp_ao_info_cmd()
1981 if (IS_ERR(ao_info)) in tcp_ao_info_cmd()
1982 return PTR_ERR(ao_info); in tcp_ao_info_cmd()
1983 if (!ao_info) { in tcp_ao_info_cmd()
1986 ao_info = tcp_ao_alloc_info(GFP_KERNEL); in tcp_ao_info_cmd()
1987 if (!ao_info) in tcp_ao_info_cmd()
2003 new_current = tcp_ao_established_key(ao_info, cmd.current_key, -1); in tcp_ao_info_cmd()
2010 new_rnext = tcp_ao_established_key(ao_info, -1, cmd.rnext); in tcp_ao_info_cmd()
2017 atomic64_set(&ao_info->counters.pkt_good, cmd.pkt_good); in tcp_ao_info_cmd()
2018 atomic64_set(&ao_info->counters.pkt_bad, cmd.pkt_bad); in tcp_ao_info_cmd()
2019 atomic64_set(&ao_info->counters.key_not_found, cmd.pkt_key_not_found); in tcp_ao_info_cmd()
2020 atomic64_set(&ao_info->counters.ao_required, cmd.pkt_ao_required); in tcp_ao_info_cmd()
2021 atomic64_set(&ao_info->counters.dropped_icmp, cmd.pkt_dropped_icmp); in tcp_ao_info_cmd()
2024 ao_info->ao_required = cmd.ao_required; in tcp_ao_info_cmd()
2025 ao_info->accept_icmps = cmd.accept_icmps; in tcp_ao_info_cmd()
2027 WRITE_ONCE(ao_info->current_key, new_current); in tcp_ao_info_cmd()
2029 WRITE_ONCE(ao_info->rnext_key, new_rnext); in tcp_ao_info_cmd()
2036 rcu_assign_pointer(tcp_sk(sk)->ao_info, ao_info); in tcp_ao_info_cmd()
2041 kfree(ao_info); in tcp_ao_info_cmd()
2104 static int tcp_ao_copy_mkts_to_user(struct tcp_ao_info *ao_info, in tcp_ao_copy_mkts_to_user() argument
2230 current_key = READ_ONCE(ao_info->current_key); in tcp_ao_copy_mkts_to_user()
2232 hlist_for_each_entry_rcu(key, &ao_info->head, node) { in tcp_ao_copy_mkts_to_user()
2239 if (opt_in.is_rnext && key == ao_info->rnext_key) in tcp_ao_copy_mkts_to_user()
2273 opt_out.is_rnext = (key == ao_info->rnext_key); in tcp_ao_copy_mkts_to_user()
2304 struct tcp_ao_info *ao_info; in tcp_ao_get_mkts() local
2306 ao_info = setsockopt_ao_info(sk); in tcp_ao_get_mkts()
2307 if (IS_ERR(ao_info)) in tcp_ao_get_mkts()
2308 return PTR_ERR(ao_info); in tcp_ao_get_mkts()
2309 if (!ao_info) in tcp_ao_get_mkts()
2312 return tcp_ao_copy_mkts_to_user(ao_info, optval, optlen); in tcp_ao_get_mkts()