| /linux/net/ipv6/ |
| H A D | inet6_hashtables.c | 317 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 D | tcp_ipv6.c | 1947 struct sock *sk2; local 1949 sk2 = inet6_lookup_listener(net, skb, __tcp_hdrlen(th), 1955 if (sk2) { 1958 sk = sk2;
|
| /linux/net/ipv4/ |
| H A D | inet_connection_sock.c | 92 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 D | inet_hashtables.c | 598 struct sock *sk2; in __inet_check_established() local 602 sk_nulls_for_each(sk2, node, &head->chain) { in __inet_check_established() 603 if (sk2->sk_hash != hash || in __inet_check_established() 604 !inet_match(net, sk2, acookie, ports, dif, sdif)) in __inet_check_established() 606 if (sk2->sk_state == TCP_TIME_WAIT) in __inet_check_established() 616 sk_nulls_for_each(sk2, node, &head->chain) { in __inet_check_established() 617 if (sk2->sk_hash != hash) in __inet_check_established() 620 if (likely(inet_match(net, sk2, acookie, ports, dif, sdif))) { in __inet_check_established() 621 if (sk2->sk_state == TCP_TIME_WAIT) { in __inet_check_established() 622 tw = inet_twsk(sk2); in __inet_check_established() [all …]
|
| H A D | udp.c | 139 struct sock *sk2; in udp_lib_lport_inuse() local 141 sk_for_each(sk2, &hslot->head) { in udp_lib_lport_inuse() 142 if (net_eq(sock_net(sk2), net) && in udp_lib_lport_inuse() 143 sk2 != sk && in udp_lib_lport_inuse() 144 (bitmap || udp_sk(sk2)->udp_port_hash == num) && in udp_lib_lport_inuse() 145 (!sk2->sk_reuse || !sk->sk_reuse) && in udp_lib_lport_inuse() 146 (!sk2->sk_bound_dev_if || !sk->sk_bound_dev_if || in udp_lib_lport_inuse() 147 sk2->sk_bound_dev_if == sk->sk_bound_dev_if) && in udp_lib_lport_inuse() 148 inet_rcv_saddr_equal(sk, sk2, true)) { in udp_lib_lport_inuse() 149 if (sk2->sk_reuseport && sk->sk_reuseport && in udp_lib_lport_inuse() [all …]
|
| H A D | af_inet.c | 790 struct sock *sk1 = sock->sk, *sk2; in inet_accept() local 794 sk2 = READ_ONCE(sk1->sk_prot)->accept(sk1, arg); in inet_accept() 795 if (!sk2) in inet_accept() 798 lock_sock(sk2); in inet_accept() 799 __inet_accept(sock, newsock, sk2); in inet_accept() 800 release_sock(sk2); in inet_accept()
|
| H A D | tcp_ipv4.c | 2308 struct sock *sk2 = inet_lookup_listener(net, skb, __tcp_hdrlen(th), local 2313 if (sk2) { 2315 sk = sk2;
|
| /linux/net/core/ |
| H A D | sock_reuseport.c | 320 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 D | filter.c | 7005 struct sock *sk2 = sk_to_full_sk(sk); in __bpf_sk_lookup() local 7010 if (sk2 != sk) { in __bpf_sk_lookup() 7013 if (unlikely(sk2 && !sock_flag(sk2, SOCK_RCU_FREE))) { in __bpf_sk_lookup() 7017 sk = sk2; in __bpf_sk_lookup() 7051 struct sock *sk2 = sk_to_full_sk(sk); in bpf_sk_lookup() local 7056 if (sk2 != sk) { in bpf_sk_lookup() 7059 if (unlikely(sk2 && !sock_flag(sk2, SOCK_RCU_FREE))) { in bpf_sk_lookup() 7063 sk = sk2; in bpf_sk_lookup()
|
| /linux/crypto/ |
| H A D | af_alg.c | 413 struct sock *sk2; in af_alg_accept() local 424 sk2 = sk_alloc(sock_net(sk), PF_ALG, GFP_KERNEL, &alg_proto, arg->kern); in af_alg_accept() 426 if (!sk2) in af_alg_accept() 429 sock_init_data(newsock, sk2); in af_alg_accept() 430 security_sock_graft(sk2, newsock); in af_alg_accept() 431 security_sk_clone(sk, sk2); in af_alg_accept() 438 err = type->accept(ask->private, sk2); in af_alg_accept() 442 err = type->accept_nokey(ask->private, sk2); in af_alg_accept() 451 atomic_set(&alg_sk(sk2)->nokey_refcnt, 1); in af_alg_accept() 453 alg_sk(sk2)->parent = sk; in af_alg_accept() [all …]
|
| H A D | algif_hash.c | 234 struct sock *sk2; in hash_accept() local 259 sk2 = newsock->sk; in hash_accept() 260 ask2 = alg_sk(sk2); in hash_accept()
|
| /linux/tools/testing/selftests/bpf/progs/ |
| H A D | test_sk_lookup.c | 327 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 D | input.c | 756 struct sock *sk2 = ep2->base.sk; in __sctp_hash_endpoint() local 758 if (!net_eq(sock_net(sk2), net) || sk2 == sk || in __sctp_hash_endpoint() 759 !uid_eq(sk_uid(sk2), sk_uid(sk)) || in __sctp_hash_endpoint() 760 !sk2->sk_reuseport) in __sctp_hash_endpoint() 763 err = sctp_bind_addrs_check(sctp_sk(sk2), in __sctp_hash_endpoint() 766 err = reuseport_add_sock(sk, sk2, any); in __sctp_hash_endpoint()
|
| H A D | socket.c | 8468 struct sock *sk2; in sctp_get_port_local() local 8488 sk_for_each_bound(sk2, &pp->owner) { in sctp_get_port_local() 8489 int bound_dev_if2 = READ_ONCE(sk2->sk_bound_dev_if); in sctp_get_port_local() 8490 struct sctp_sock *sp2 = sctp_sk(sk2); in sctp_get_port_local() 8493 if (sk == sk2 || in sctp_get_port_local() 8494 (reuse && (sk2->sk_reuse || sp2->reuse) && in sctp_get_port_local() 8495 sk2->sk_state != SCTP_SS_LISTENING) || in sctp_get_port_local() 8496 (sk->sk_reuseport && sk2->sk_reuseport && in sctp_get_port_local() 8497 uid_eq(uid, sk_uid(sk2)))) in sctp_get_port_local()
|
| /linux/include/net/ |
| H A D | sock_reuseport.h | 33 extern int reuseport_add_sock(struct sock *sk, struct sock *sk2,
|
| H A D | addrconf.h | 147 bool inet_rcv_saddr_equal(const struct sock *sk, const struct sock *sk2,
|
| /linux/net/unix/ |
| H A D | af_unix.c | 1485 static void unix_state_double_lock(struct sock *sk1, struct sock *sk2) in unix_state_double_lock() argument 1487 if (unlikely(sk1 == sk2) || !sk2) { in unix_state_double_lock() 1492 if (sk1 > sk2) in unix_state_double_lock() 1493 swap(sk1, sk2); in unix_state_double_lock() 1496 unix_state_lock(sk2); in unix_state_double_lock() 1499 static void unix_state_double_unlock(struct sock *sk1, struct sock *sk2) in unix_state_double_unlock() argument 1501 if (unlikely(sk1 == sk2) || !sk2) { in unix_state_double_unlock() 1506 unix_state_unlock(sk2); in unix_state_double_unlock()
|