Home
last modified time | relevance | path

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

/linux/net/ipv6/
H A Dinet6_hashtables.c317 struct sock *sk2; in __inet6_check_established() local
321 sk_nulls_for_each(sk2, node, &head->chain) { in __inet6_check_established()
322 if (sk2->sk_hash != hash || in __inet6_check_established()
323 !inet6_match(net, sk2, saddr, daddr, in __inet6_check_established()
326 if (sk2->sk_state == TCP_TIME_WAIT) in __inet6_check_established()
336 sk_nulls_for_each(sk2, node, &head->chain) { in __inet6_check_established()
337 if (sk2->sk_hash != hash) in __inet6_check_established()
340 if (likely(inet6_match(net, sk2, saddr, daddr, ports, in __inet6_check_established()
342 if (sk2->sk_state == TCP_TIME_WAIT) { in __inet6_check_established()
343 tw = inet_twsk(sk2); in __inet6_check_established()
[all …]
H A Dtcp_ipv6.c1965 struct sock *sk2; local
1967 sk2 = inet6_lookup_listener(net, skb, __tcp_hdrlen(th),
1973 if (sk2) {
1976 sk = sk2;
/linux/net/ipv4/
H A Dinet_connection_sock.c92 bool inet_rcv_saddr_equal(const struct sock *sk, const struct sock *sk2, in inet_rcv_saddr_equal() argument
98 inet6_rcv_saddr(sk2), in inet_rcv_saddr_equal()
100 sk2->sk_rcv_saddr, in inet_rcv_saddr_equal()
102 ipv6_only_sock(sk2), in inet_rcv_saddr_equal()
106 return ipv4_rcv_saddr_equal(sk->sk_rcv_saddr, sk2->sk_rcv_saddr, in inet_rcv_saddr_equal()
107 ipv6_only_sock(sk2), match_wildcard, in inet_rcv_saddr_equal()
156 static bool inet_bind_conflict(const struct sock *sk, struct sock *sk2, in inet_bind_conflict() argument
162 if (sk == sk2) in inet_bind_conflict()
165 bound_dev_if2 = READ_ONCE(sk2->sk_bound_dev_if); in inet_bind_conflict()
169 if (sk->sk_reuse && sk2->sk_reuse && in inet_bind_conflict()
[all …]
H A Dudp.c140 struct sock *sk2; in udp_lib_lport_inuse() local
142 sk_for_each(sk2, &hslot->head) { in udp_lib_lport_inuse()
143 if (net_eq(sock_net(sk2), net) && in udp_lib_lport_inuse()
144 sk2 != sk && in udp_lib_lport_inuse()
145 (bitmap || udp_sk(sk2)->udp_port_hash == num) && in udp_lib_lport_inuse()
146 (!sk2->sk_reuse || !sk->sk_reuse) && in udp_lib_lport_inuse()
147 (!sk2->sk_bound_dev_if || !sk->sk_bound_dev_if || in udp_lib_lport_inuse()
148 sk2->sk_bound_dev_if == sk->sk_bound_dev_if) && in udp_lib_lport_inuse()
149 inet_rcv_saddr_equal(sk, sk2, true)) { in udp_lib_lport_inuse()
150 if (sk2->sk_reuseport && sk->sk_reuseport && in udp_lib_lport_inuse()
[all …]
H A Dtcp_ipv4.c2310 struct sock *sk2 = inet_lookup_listener(net, skb, __tcp_hdrlen(th), local
2315 if (sk2) {
2317 sk = sk2;
/linux/net/ipv4/netfilter/
H A 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()
/linux/net/ipv6/netfilter/
H A 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()
/linux/net/core/
H A Dsock_reuseport.c320 int reuseport_add_sock(struct sock *sk, struct sock *sk2, bool bind_inany) in reuseport_add_sock() argument
324 if (!rcu_access_pointer(sk2->sk_reuseport_cb)) { in reuseport_add_sock()
325 int err = reuseport_alloc(sk2, bind_inany); in reuseport_add_sock()
332 reuse = rcu_dereference_protected(sk2->sk_reuseport_cb, in reuseport_add_sock()
575 struct sock *sk2 = NULL; in reuseport_select_sock() local
595 sk2 = bpf_run_sk_reuseport(reuse, sk, prog, skb, NULL, hash); in reuseport_select_sock()
597 sk2 = run_bpf_filter(reuse, socks, prog, skb, hdr_len); in reuseport_select_sock()
601 if (!sk2) in reuseport_select_sock()
602 sk2 = reuseport_select_sock_by_hash(reuse, hash, socks); in reuseport_select_sock()
607 return sk2; in reuseport_select_sock()
H A Dfilter.c7257 struct sock *sk2 = sk_to_full_sk(sk); in bpf_sk_lookup_full_sk() local
7263 if (sk2 != sk) { in bpf_sk_lookup_full_sk()
7266 if (unlikely(sk2 && !sock_flag(sk2, SOCK_RCU_FREE))) { in bpf_sk_lookup_full_sk()
7270 sk = sk2; in bpf_sk_lookup_full_sk()
/linux/tools/testing/selftests/bpf/progs/
H A Dtest_sk_lookup.c327 struct bpf_sock *sk1 = NULL, *sk2 = NULL; in access_ctx_sk() local
360 sk2 = bpf_map_lookup_elem(&redir_map, &KEY_SERVER_B); in access_ctx_sk()
361 if (!sk2) in access_ctx_sk()
363 err = bpf_sk_assign(ctx, sk2, BPF_SK_LOOKUP_F_REPLACE); in access_ctx_sk()
366 if (ctx->sk != sk2) in access_ctx_sk()
379 if (sk2) in access_ctx_sk()
380 bpf_sk_release(sk2); in access_ctx_sk()
/linux/net/sctp/
H A Dinput.c757 struct sock *sk2 = ep2->base.sk; in __sctp_hash_endpoint() local
759 if (!net_eq(sock_net(sk2), net) || sk2 == sk || in __sctp_hash_endpoint()
760 !uid_eq(sk_uid(sk2), sk_uid(sk)) || in __sctp_hash_endpoint()
761 !sk2->sk_reuseport) in __sctp_hash_endpoint()
764 err = sctp_bind_addrs_check(sctp_sk(sk2), in __sctp_hash_endpoint()
767 err = reuseport_add_sock(sk, sk2, any); in __sctp_hash_endpoint()
H A Dsocket.c8478 * socket is going to be sk2. in sctp_get_port_local()
8480 struct sock *sk2; in sctp_get_port_local()
8492 * bind_pprev in the struct sock *sk2 (pp->sk)]. On each one, in sctp_get_port_local()
8500 sk_for_each_bound(sk2, &pp->owner) { in sctp_get_port_local()
8501 int bound_dev_if2 = READ_ONCE(sk2->sk_bound_dev_if); in sctp_get_port_local()
8502 struct sctp_sock *sp2 = sctp_sk(sk2); in sctp_get_port_local()
8505 if (sk == sk2 || in sctp_get_port_local()
8506 (reuse && (sk2->sk_reuse || sp2->reuse) && in sctp_get_port_local()
8507 sk2->sk_state != SCTP_SS_LISTENING) || in sctp_get_port_local()
8508 (sk->sk_reuseport && sk2 in sctp_get_port_local()
8484 struct sock *sk2; sctp_get_port_local() local
[all...]
/linux/include/net/
H A Dsock_reuseport.h33 extern int reuseport_add_sock(struct sock *sk, struct sock *sk2,
H A Daddrconf.h147 bool inet_rcv_saddr_equal(const struct sock *sk, const struct sock *sk2,
/linux/net/unix/
H A Daf_unix.c1491 static void unix_state_double_lock(struct sock *sk1, struct sock *sk2) in unix_state_double_lock() argument
1493 if (unlikely(sk1 == sk2) || !sk2) { in unix_state_double_lock()
1498 if (sk1 > sk2) in unix_state_double_lock()
1499 swap(sk1, sk2); in unix_state_double_lock()
1502 unix_state_lock(sk2); in unix_state_double_lock()
1505 static void unix_state_double_unlock(struct sock *sk1, struct sock *sk2) in unix_state_double_unlock() argument
1507 if (unlikely(sk1 == sk2) || !sk2) { in unix_state_double_unlock()
1512 unix_state_unlock(sk2); in unix_state_double_unlock()