Home
last modified time | relevance | path

Searched refs:sk2 (Results 1 – 15 of 15) sorted by relevance

/net/core/
Dsock_reuseport.c152 int reuseport_add_sock(struct sock *sk, struct sock *sk2, bool bind_inany) in reuseport_add_sock() argument
156 if (!rcu_access_pointer(sk2->sk_reuseport_cb)) { in reuseport_add_sock()
157 int err = reuseport_alloc(sk2, bind_inany); in reuseport_add_sock()
164 reuse = rcu_dereference_protected(sk2->sk_reuseport_cb, in reuseport_add_sock()
273 struct sock *sk2 = NULL; in reuseport_select_sock() local
293 sk2 = bpf_run_sk_reuseport(reuse, sk, prog, skb, hash); in reuseport_select_sock()
295 sk2 = run_bpf_filter(reuse, socks, prog, skb, hdr_len); in reuseport_select_sock()
299 if (!sk2) { in reuseport_select_sock()
310 sk2 = reuse->socks[i]; in reuseport_select_sock()
316 return sk2; in reuseport_select_sock()
Dfilter.c5347 struct sock *sk2 = sk_to_full_sk(sk); in __bpf_sk_lookup() local
5352 if (!sk_fullsock(sk2)) in __bpf_sk_lookup()
5353 sk2 = NULL; in __bpf_sk_lookup()
5354 if (sk2 != sk) { in __bpf_sk_lookup()
5357 if (unlikely(sk2 && !sock_flag(sk2, SOCK_RCU_FREE))) { in __bpf_sk_lookup()
5361 sk = sk2; in __bpf_sk_lookup()
5395 struct sock *sk2 = sk_to_full_sk(sk); in bpf_sk_lookup() local
5400 if (!sk_fullsock(sk2)) in bpf_sk_lookup()
5401 sk2 = NULL; in bpf_sk_lookup()
5402 if (sk2 != sk) { in bpf_sk_lookup()
[all …]
/net/ipv4/
Dinet_hashtables.c418 struct sock *sk2; in __inet_check_established() local
424 sk_nulls_for_each(sk2, node, &head->chain) { in __inet_check_established()
425 if (sk2->sk_hash != hash) in __inet_check_established()
428 if (likely(INET_MATCH(sk2, net, acookie, in __inet_check_established()
430 if (sk2->sk_state == TCP_TIME_WAIT) { in __inet_check_established()
431 tw = inet_twsk(sk2); in __inet_check_established()
432 if (twsk_unique(sk, sk2, twp)) in __inet_check_established()
575 struct sock *sk2; in inet_reuseport_add_sock() local
578 sk_nulls_for_each_rcu(sk2, node, &ilb->nulls_head) { in inet_reuseport_add_sock()
579 if (sk2 != sk && in inet_reuseport_add_sock()
[all …]
Dinet_connection_sock.c91 bool inet_rcv_saddr_equal(const struct sock *sk, const struct sock *sk2, in inet_rcv_saddr_equal() argument
97 inet6_rcv_saddr(sk2), in inet_rcv_saddr_equal()
99 sk2->sk_rcv_saddr, in inet_rcv_saddr_equal()
101 ipv6_only_sock(sk2), in inet_rcv_saddr_equal()
105 return ipv4_rcv_saddr_equal(sk->sk_rcv_saddr, sk2->sk_rcv_saddr, in inet_rcv_saddr_equal()
106 ipv6_only_sock(sk2), match_wildcard, in inet_rcv_saddr_equal()
137 struct sock *sk2; in inet_csk_bind_conflict() local
149 sk_for_each_bound(sk2, &tb->owners) { in inet_csk_bind_conflict()
150 if (sk != sk2 && in inet_csk_bind_conflict()
152 !sk2->sk_bound_dev_if || in inet_csk_bind_conflict()
[all …]
Dudp.c133 struct sock *sk2; in udp_lib_lport_inuse() local
136 sk_for_each(sk2, &hslot->head) { in udp_lib_lport_inuse()
137 if (net_eq(sock_net(sk2), net) && in udp_lib_lport_inuse()
138 sk2 != sk && in udp_lib_lport_inuse()
139 (bitmap || udp_sk(sk2)->udp_port_hash == num) && in udp_lib_lport_inuse()
140 (!sk2->sk_reuse || !sk->sk_reuse) && in udp_lib_lport_inuse()
141 (!sk2->sk_bound_dev_if || !sk->sk_bound_dev_if || in udp_lib_lport_inuse()
142 sk2->sk_bound_dev_if == sk->sk_bound_dev_if) && in udp_lib_lport_inuse()
143 inet_rcv_saddr_equal(sk, sk2, true)) { in udp_lib_lport_inuse()
144 if (sk2->sk_reuseport && sk->sk_reuseport && in udp_lib_lport_inuse()
[all …]
Dping.c82 struct sock *sk2 = NULL; in ping_get_port() local
95 ping_portaddr_for_each_entry(sk2, node, hlist) { in ping_get_port()
96 isk2 = inet_sk(sk2); in ping_get_port()
112 ping_portaddr_for_each_entry(sk2, node, hlist) { in ping_get_port()
113 isk2 = inet_sk(sk2); in ping_get_port()
120 (sk2 != sk) && in ping_get_port()
121 (!sk2->sk_reuse || !sk->sk_reuse)) in ping_get_port()
Daf_inet.c738 struct sock *sk2 = sk1->sk_prot->accept(sk1, flags, &err, kern); in inet_accept() local
740 if (!sk2) in inet_accept()
743 lock_sock(sk2); in inet_accept()
745 sock_rps_record_flow(sk2); in inet_accept()
746 WARN_ON(!((1 << sk2->sk_state) & in inet_accept()
750 sock_graft(sk2, newsock); in inet_accept()
754 release_sock(sk2); in inet_accept()
Dtcp_ipv4.c2027 struct sock *sk2 = inet_lookup_listener(dev_net(skb->dev), in tcp_v4_rcv() local
2034 if (sk2) { in tcp_v4_rcv()
2036 sk = sk2; in tcp_v4_rcv()
/net/ipv6/
Dinet6_hashtables.c216 struct sock *sk2; in __inet6_check_established() local
222 sk_nulls_for_each(sk2, node, &head->chain) { in __inet6_check_established()
223 if (sk2->sk_hash != hash) in __inet6_check_established()
226 if (likely(INET6_MATCH(sk2, net, saddr, daddr, ports, in __inet6_check_established()
228 if (sk2->sk_state == TCP_TIME_WAIT) { in __inet6_check_established()
229 tw = inet_twsk(sk2); in __inet6_check_established()
230 if (twsk_unique(sk, sk2, twp)) in __inet6_check_established()
Dtcp_ipv6.c1698 struct sock *sk2; in tcp_v6_rcv() local
1700 sk2 = inet6_lookup_listener(dev_net(skb->dev), &tcp_hashinfo, in tcp_v6_rcv()
1707 if (sk2) { in tcp_v6_rcv()
1710 sk = sk2; in tcp_v6_rcv()
/net/ipv4/netfilter/
Dnf_tproxy_ipv4.c34 struct sock *sk2; in nf_tproxy_handle_time_wait4() local
36 sk2 = nf_tproxy_get_sock_v4(net, skb, iph->protocol, in nf_tproxy_handle_time_wait4()
40 if (sk2) { in nf_tproxy_handle_time_wait4()
42 sk = sk2; in nf_tproxy_handle_time_wait4()
/net/ipv6/netfilter/
Dnf_tproxy_ipv6.c57 struct sock *sk2; in nf_tproxy_handle_time_wait6() local
59 sk2 = nf_tproxy_get_sock_v6(net, skb, thoff, tproto, in nf_tproxy_handle_time_wait6()
65 if (sk2) { in nf_tproxy_handle_time_wait6()
67 sk = sk2; in nf_tproxy_handle_time_wait6()
/net/sctp/
Dinput.c741 struct sock *sk2 = epb2->sk; in __sctp_hash_endpoint() local
743 if (!net_eq(sock_net(sk2), net) || sk2 == sk || in __sctp_hash_endpoint()
744 !uid_eq(sock_i_uid(sk2), sock_i_uid(sk)) || in __sctp_hash_endpoint()
745 !sk2->sk_reuseport) in __sctp_hash_endpoint()
748 err = sctp_bind_addrs_check(sctp_sk(sk2), in __sctp_hash_endpoint()
751 err = reuseport_add_sock(sk, sk2, any); in __sctp_hash_endpoint()
Dsocket.c8263 struct sock *sk2; in sctp_get_port_local() local
8283 sk_for_each_bound(sk2, &pp->owner) { in sctp_get_port_local()
8284 struct sctp_sock *sp2 = sctp_sk(sk2); in sctp_get_port_local()
8287 if (sk == sk2 || in sctp_get_port_local()
8288 (reuse && (sk2->sk_reuse || sp2->reuse) && in sctp_get_port_local()
8289 sk2->sk_state != SCTP_SS_LISTENING) || in sctp_get_port_local()
8290 (sk->sk_reuseport && sk2->sk_reuseport && in sctp_get_port_local()
8291 uid_eq(uid, sock_i_uid(sk2)))) in sctp_get_port_local()
/net/unix/
Daf_unix.c1115 static void unix_state_double_lock(struct sock *sk1, struct sock *sk2) in unix_state_double_lock() argument
1117 if (unlikely(sk1 == sk2) || !sk2) { in unix_state_double_lock()
1121 if (sk1 > sk2) in unix_state_double_lock()
1122 swap(sk1, sk2); in unix_state_double_lock()
1125 unix_state_lock_nested(sk2, U_LOCK_SECOND); in unix_state_double_lock()
1128 static void unix_state_double_unlock(struct sock *sk1, struct sock *sk2) in unix_state_double_unlock() argument
1130 if (unlikely(sk1 == sk2) || !sk2) { in unix_state_double_unlock()
1135 unix_state_unlock(sk2); in unix_state_double_unlock()