/linux/net/dccp/ |
H A D | ipv6.c | 430 struct sock *newsk; in dccp_v6_request_recv_sock() local 436 newsk = dccp_v4_request_recv_sock(sk, skb, req, dst, in dccp_v6_request_recv_sock() 438 if (newsk == NULL) in dccp_v6_request_recv_sock() 441 newdp6 = (struct dccp6_sock *)newsk; in dccp_v6_request_recv_sock() 442 newinet = inet_sk(newsk); in dccp_v6_request_recv_sock() 444 newnp = inet6_sk(newsk); in dccp_v6_request_recv_sock() 448 newnp->saddr = newsk->sk_v6_rcv_saddr; in dccp_v6_request_recv_sock() 450 inet_csk(newsk)->icsk_af_ops = &dccp_ipv6_mapped; in dccp_v6_request_recv_sock() 451 newsk->sk_backlog_rcv = dccp_v4_do_rcv; in dccp_v6_request_recv_sock() 470 dccp_sync_mss(newsk, inet_csk(newsk)->icsk_pmtu_cookie); in dccp_v6_request_recv_sock() [all …]
|
H A D | minisocks.c | 82 struct sock *newsk = inet_csk_clone_lock(sk, req, GFP_ATOMIC); in dccp_create_openreq_child() local 84 if (newsk != NULL) { in dccp_create_openreq_child() 86 struct inet_connection_sock *newicsk = inet_csk(newsk); in dccp_create_openreq_child() 87 struct dccp_sock *newdp = dccp_sk(newsk); in dccp_create_openreq_child() 120 if (dccp_feat_activate_values(newsk, &dreq->dreq_featneg)) { in dccp_create_openreq_child() 121 sk_free_unlock_clone(newsk); in dccp_create_openreq_child() 124 dccp_init_xmit_timers(newsk); in dccp_create_openreq_child() 128 return newsk; in dccp_create_openreq_child()
|
H A D | ipv4.c | 417 struct sock *newsk; in dccp_v4_request_recv_sock() local 422 newsk = dccp_create_openreq_child(sk, req, skb); in dccp_v4_request_recv_sock() 423 if (newsk == NULL) in dccp_v4_request_recv_sock() 426 newinet = inet_sk(newsk); in dccp_v4_request_recv_sock() 428 sk_daddr_set(newsk, ireq->ir_rmt_addr); in dccp_v4_request_recv_sock() 429 sk_rcv_saddr_set(newsk, ireq->ir_loc_addr); in dccp_v4_request_recv_sock() 436 if (dst == NULL && (dst = inet_csk_route_child_sock(sk, newsk, req)) == NULL) in dccp_v4_request_recv_sock() 439 sk_setup_caps(newsk, dst); in dccp_v4_request_recv_sock() 441 dccp_sync_mss(newsk, dst_mtu(dst)); in dccp_v4_request_recv_sock() 443 if (__inet_inherit_port(sk, newsk) < in dccp_v4_request_recv_sock() [all...] |
/linux/net/ipv4/ |
H A D | inet_connection_sock.c | 669 struct sock *newsk; in inet_csk_accept() local 696 newsk = req->sk; in inet_csk_accept() 716 if (newsk && mem_cgroup_sockets_enabled) { in inet_csk_accept() 723 lock_sock(newsk); in inet_csk_accept() 725 mem_cgroup_sk_alloc(newsk); in inet_csk_accept() 726 if (newsk->sk_memcg) { in inet_csk_accept() 730 amt = sk_mem_pages(newsk->sk_forward_alloc + in inet_csk_accept() 731 atomic_read(&newsk->sk_rmem_alloc)); in inet_csk_accept() 735 mem_cgroup_charge_skmem(newsk->sk_memcg, amt, gfp); in inet_csk_accept() 736 kmem_cache_charge(newsk, gfp); in inet_csk_accept() [all …]
|
H A D | tcp_minisocks.c | 517 struct sock *newsk = inet_csk_clone_lock(sk, req, GFP_ATOMIC); in tcp_create_openreq_child() local 525 if (!newsk) in tcp_create_openreq_child() 528 newicsk = inet_csk(newsk); in tcp_create_openreq_child() 529 newtp = tcp_sk(newsk); in tcp_create_openreq_child() 557 newsk->sk_txhash = READ_ONCE(treq->txhash); in tcp_create_openreq_child() 560 tcp_init_xmit_timers(newsk); in tcp_create_openreq_child() 563 if (sock_flag(newsk, SOCK_KEEPOPEN)) in tcp_create_openreq_child() 564 inet_csk_reset_keepalive_timer(newsk, in tcp_create_openreq_child() 631 tcp_bpf_clone(sk, newsk); in tcp_create_openreq_child() 635 xa_init_flags(&newsk->sk_user_frags, XA_FLAGS_ALLOC1); in tcp_create_openreq_child() [all …]
|
H A D | tcp_ipv4.c | 1750 struct sock *newsk; local 1761 newsk = tcp_create_openreq_child(sk, req, skb); 1762 if (!newsk) 1765 newsk->sk_gso_type = SKB_GSO_TCPV4; 1766 inet_sk_rx_dst_set(newsk, skb); 1768 newtp = tcp_sk(newsk); 1769 newinet = inet_sk(newsk); 1771 sk_daddr_set(newsk, ireq->ir_rmt_addr); 1772 sk_rcv_saddr_set(newsk, ireq->ir_loc_addr); 1773 newsk->sk_bound_dev_if = ireq->ir_iif; [all …]
|
/linux/net/ipv6/ |
H A D | tcp_ipv6.c | 1359 struct sock *newsk; local 1371 newsk = tcp_v4_syn_recv_sock(sk, skb, req, dst, 1374 if (!newsk) 1377 inet_sk(newsk)->pinet6 = tcp_inet6_sk(newsk); 1379 newnp = tcp_inet6_sk(newsk); 1380 newtp = tcp_sk(newsk); 1384 newnp->saddr = newsk->sk_v6_rcv_saddr; 1386 inet_csk(newsk)->icsk_af_ops = &ipv6_mapped; 1387 if (sk_is_mptcp(newsk)) 1388 mptcpv6_handle_mapped(newsk, true); [all …]
|
/linux/drivers/net/ethernet/chelsio/inline_crypto/chtls/ |
H A D | chtls_cm.c | 1072 static void inet_inherit_port(struct sock *lsk, struct sock *newsk) in inet_inherit_port() argument 1075 __inet_inherit_port(lsk, newsk); in inet_inherit_port() 1123 struct sock *newsk; in chtls_recv_sock() local 1130 newsk = tcp_create_openreq_child(lsk, oreq, cdev->askb); in chtls_recv_sock() 1131 if (!newsk) in chtls_recv_sock() 1135 dst = inet_csk_route_child_sock(lsk, newsk, oreq); in chtls_recv_sock() 1183 newsk->sk_user_data = csk; in chtls_recv_sock() 1184 newsk->sk_backlog_rcv = chtls_backlog_rcv; in chtls_recv_sock() 1186 tp = tcp_sk(newsk); in chtls_recv_sock() 1187 newinet = inet_sk(newsk); in chtls_recv_sock() [all …]
|
/linux/tools/testing/selftests/bpf/progs/ |
H A D | lsm_cgroup.c | 167 int BPF_PROG(socket_clone, struct sock *newsk, const struct request_sock *req) in BPF_PROG() argument 171 if (!newsk) in BPF_PROG() 175 if (bpf_setsockopt(newsk, SOL_SOCKET, SO_PRIORITY, &prio, sizeof(prio))) in BPF_PROG() 180 if (bpf_getsockopt(newsk, SOL_SOCKET, SO_PRIORITY, &prio, sizeof(prio))) in BPF_PROG()
|
H A D | lsm_cgroup_nonvoid.c | 10 int BPF_PROG(nonvoid_socket_clone, struct sock *newsk, const struct request_sock *req) in BPF_PROG() argument
|
/linux/net/core/ |
H A D | sock.c | 2372 struct sock *newsk; in sk_clone_lock() local 2374 newsk = sk_prot_alloc(prot, priority, sk->sk_family); in sk_clone_lock() 2375 if (!newsk) in sk_clone_lock() 2378 sock_copy(newsk, sk); in sk_clone_lock() 2380 newsk->sk_prot_creator = prot; in sk_clone_lock() 2383 if (likely(newsk->sk_net_refcnt)) { in sk_clone_lock() 2384 get_net_track(sock_net(newsk), &newsk->ns_tracker, priority); in sk_clone_lock() 2385 sock_inuse_add(sock_net(newsk), 1); in sk_clone_lock() 2392 __netns_tracker_alloc(sock_net(newsk), &newsk->ns_tracker, in sk_clone_lock() 2395 sk_node_init(&newsk->sk_node); in sk_clone_lock() [all …]
|
/linux/net/phonet/ |
H A D | pep.c | 766 struct sock *newsk = NULL; in pep_sock_accept() local 829 newsk = pep_find_pipe(&pn->hlist, &dst, pipe_handle); in pep_sock_accept() 830 if (unlikely(newsk)) { in pep_sock_accept() 831 __sock_put(newsk); in pep_sock_accept() 832 newsk = NULL; in pep_sock_accept() 838 newsk = sk_alloc(sock_net(sk), PF_PHONET, GFP_KERNEL, sk->sk_prot, in pep_sock_accept() 840 if (!newsk) { in pep_sock_accept() 846 sock_init_data(NULL, newsk); in pep_sock_accept() 847 newsk->sk_state = TCP_SYN_RECV; in pep_sock_accept() 848 newsk->sk_backlog_rcv = pipe_do_rcv; in pep_sock_accept() [all …]
|
H A D | socket.c | 298 struct sock *newsk; in pn_socket_accept() local 303 newsk = sk->sk_prot->accept(sk, arg); in pn_socket_accept() 304 if (!newsk) in pn_socket_accept() 307 lock_sock(newsk); in pn_socket_accept() 308 sock_graft(newsk, newsock); in pn_socket_accept() 310 release_sock(newsk); in pn_socket_accept()
|
/linux/net/tipc/ |
H A D | topsrv.c | 460 struct sock *newsk; in tipc_topsrv_accept() local 482 newsk = newsock->sk; in tipc_topsrv_accept() 483 write_lock_bh(&newsk->sk_callback_lock); in tipc_topsrv_accept() 484 newsk->sk_data_ready = tipc_conn_data_ready; in tipc_topsrv_accept() 485 newsk->sk_write_space = tipc_conn_write_space; in tipc_topsrv_accept() 486 newsk->sk_user_data = con; in tipc_topsrv_accept() 487 write_unlock_bh(&newsk->sk_callback_lock); in tipc_topsrv_accept() 490 newsk->sk_data_ready(newsk); in tipc_topsrv_accept()
|
/linux/include/net/ |
H A D | bpf_sk_storage.h | 32 int bpf_sk_storage_clone(const struct sock *sk, struct sock *newsk); 42 struct sock *newsk) in bpf_sk_storage_clone() argument
|
H A D | inet_common.h | 35 struct sock *newsk);
|
/linux/net/sctp/ |
H A D | protocol.c | 177 static void sctp_v4_copy_ip_options(struct sock *sk, struct sock *newsk) in sctp_v4_copy_ip_options() argument 182 newinet = inet_sk(newsk); in sctp_v4_copy_ip_options() 187 newopt = sock_kmalloc(newsk, sizeof(*inet_opt) + in sctp_v4_copy_ip_options() 586 struct sock *newsk = sk_alloc(sock_net(sk), PF_INET, GFP_KERNEL, in sctp_v4_create_accept_sk() local 590 if (!newsk) in sctp_v4_create_accept_sk() 593 sock_init_data(NULL, newsk); in sctp_v4_create_accept_sk() 595 sctp_copy_sock(newsk, sk, asoc); in sctp_v4_create_accept_sk() 596 sock_reset_flag(newsk, SOCK_ZAPPED); in sctp_v4_create_accept_sk() 598 sctp_v4_copy_ip_options(sk, newsk); in sctp_v4_create_accept_sk() 600 newinet = inet_sk(newsk); in sctp_v4_create_accept_sk() [all …]
|
H A D | socket.c | 92 static int sctp_sock_migrate(struct sock *oldsk, struct sock *newsk, 4858 struct sock *newsk = NULL; in sctp_accept() local 4890 newsk = sp->pf->create_accept_sk(sk, asoc, arg->kern); in sctp_accept() 4891 if (!newsk) { in sctp_accept() 4899 error = sctp_sock_migrate(sk, newsk, asoc, SCTP_SOCKET_TCP); in sctp_accept() 4901 sk_common_release(newsk); in sctp_accept() 4902 newsk = NULL; in sctp_accept() 4908 return newsk; in sctp_accept() 9464 void sctp_copy_sock(struct sock *newsk, struct sock *sk, in sctp_copy_sock() argument 9471 newsk->sk_type = sk->sk_type; in sctp_copy_sock() [all …]
|
/linux/security/selinux/include/ |
H A D | netlabel.h | 42 void selinux_netlbl_sctp_sk_clone(struct sock *sk, struct sock *newsk); 106 struct sock *newsk) in selinux_netlbl_sctp_sk_clone() argument
|
/linux/net/llc/ |
H A D | llc_conn.c | 764 struct sock *newsk = llc_sk_alloc(sock_net(sk), sk->sk_family, GFP_ATOMIC, in llc_create_incoming_sock() local 768 if (!newsk) in llc_create_incoming_sock() 770 newllc = llc_sk(newsk); in llc_create_incoming_sock() 775 llc_sap_add_socket(llc->sap, newsk); in llc_create_incoming_sock() 778 return newsk; in llc_create_incoming_sock() 805 struct sock *newsk = llc_create_incoming_sock(sk, skb->dev, in llc_conn_handler() local 807 if (!newsk) in llc_conn_handler() 809 skb_set_owner_r(skb, newsk); in llc_conn_handler()
|
H A D | af_llc.c | 699 struct sock *sk = sock->sk, *newsk; in llc_ui_accept() local 726 newsk = skb->sk; in llc_ui_accept() 728 llc_ui_sk_init(newsock, newsk); in llc_ui_accept() 729 sock_reset_flag(newsk, SOCK_ZAPPED); in llc_ui_accept() 730 newsk->sk_state = TCP_ESTABLISHED; in llc_ui_accept() 733 newllc = llc_sk(newsk); in llc_ui_accept()
|
/linux/net/mptcp/ |
H A D | protocol.c | 3254 static void mptcp_copy_ip6_options(struct sock *newsk, const struct sock *sk) in mptcp_copy_ip6_options() argument 3260 newnp = inet6_sk(newsk); in mptcp_copy_ip6_options() 3265 opt = ipv6_dup_options(newsk, opt); in mptcp_copy_ip6_options() 3274 static void mptcp_copy_ip_options(struct sock *newsk, const struct sock *sk) in mptcp_copy_ip_options() argument 3280 newinet = inet_sk(newsk); in mptcp_copy_ip_options() 3285 newopt = sock_kmalloc(newsk, sizeof(*inet_opt) + in mptcp_copy_ip_options() 3928 struct sock *ssk, *newsk; in mptcp_stream_accept() local 3940 newsk = inet_csk_accept(ssk, arg); in mptcp_stream_accept() 3941 if (!newsk) in mptcp_stream_accept() 3944 pr_debug("newsk=%p, subflow is mptcp=%d\n", newsk, sk_is_mptcp(newsk)); in mptcp_stream_accept() [all …]
|
/linux/include/linux/ |
H A D | skbuff.h | 2262 static inline void __skb_insert(struct sk_buff *newsk, in __skb_insert() argument 2269 WRITE_ONCE(newsk->next, next); in __skb_insert() 2270 WRITE_ONCE(newsk->prev, prev); in __skb_insert() 2271 WRITE_ONCE(((struct sk_buff_list *)next)->prev, newsk); in __skb_insert() 2272 WRITE_ONCE(((struct sk_buff_list *)prev)->next, newsk); in __skb_insert() 2366 struct sk_buff *newsk) in __skb_queue_after() argument 2368 __skb_insert(newsk, prev, ((struct sk_buff_list *)prev)->next, list); in __skb_queue_after() 2371 void skb_append(struct sk_buff *old, struct sk_buff *newsk, 2376 struct sk_buff *newsk) in __skb_queue_before() argument 2378 __skb_insert(newsk, ((struct sk_buff_list *)next)->prev, next, list); in __skb_queue_before() [all …]
|
H A D | security.h | 1621 int security_unix_stream_connect(struct sock *sock, struct sock *other, struct sock *newsk); 1645 void security_sk_clone(const struct sock *sk, struct sock *newsk); 1653 void security_inet_csk_clone(struct sock *newsk, 1670 struct sock *newsk); 1678 struct sock *newsk) in security_unix_stream_connect() argument 1801 static inline void security_sk_clone(const struct sock *sk, struct sock *newsk) in security_sk_clone() argument 1825 static inline void security_inet_csk_clone(struct sock *newsk, in security_inet_csk_clone() argument 1892 struct sock *newsk) in security_sctp_sk_clone() argument
|
/linux/net/unix/ |
H A D | af_unix.c | 1539 struct sock *sk = sock->sk, *newsk = NULL, *other = NULL; in unix_stream_connect() local 1571 newsk = unix_create1(net, NULL, 0, sock->type); in unix_stream_connect() 1572 if (IS_ERR(newsk)) { in unix_stream_connect() 1573 err = PTR_ERR(newsk); in unix_stream_connect() 1574 newsk = NULL; in unix_stream_connect() 1581 skb = sock_wmalloc(newsk, 1, 0, GFP_KERNEL); in unix_stream_connect() 1640 err = security_unix_stream_connect(sk, other, newsk); in unix_stream_connect() 1649 unix_peer(newsk) = sk; in unix_stream_connect() 1650 newsk->sk_state = TCP_ESTABLISHED; in unix_stream_connect() 1651 newsk->sk_type = sk->sk_type; in unix_stream_connect() [all …]
|