Home
last modified time | relevance | path

Searched refs:newsk (Results 1 – 25 of 48) sorted by relevance

12

/kernel/linux/linux-5.10/net/ipv4/
Dinet_connection_sock.c473 struct sock *newsk; in inet_csk_accept() local
499 newsk = req->sk; in inet_csk_accept()
519 if (newsk && mem_cgroup_sockets_enabled) { in inet_csk_accept()
525 lock_sock(newsk); in inet_csk_accept()
530 amt = sk_mem_pages(newsk->sk_forward_alloc + in inet_csk_accept()
531 atomic_read(&newsk->sk_rmem_alloc)); in inet_csk_accept()
532 mem_cgroup_sk_alloc(newsk); in inet_csk_accept()
533 if (newsk->sk_memcg && amt) in inet_csk_accept()
534 mem_cgroup_charge_skmem(newsk->sk_memcg, amt); in inet_csk_accept()
536 release_sock(newsk); in inet_csk_accept()
[all …]
Dtcp_minisocks.c460 struct sock *newsk = inet_csk_clone_lock(sk, req, GFP_ATOMIC); in tcp_create_openreq_child() local
467 if (!newsk) in tcp_create_openreq_child()
470 newicsk = inet_csk(newsk); in tcp_create_openreq_child()
471 newtp = tcp_sk(newsk); in tcp_create_openreq_child()
499 newsk->sk_txhash = treq->txhash; in tcp_create_openreq_child()
502 tcp_init_xmit_timers(newsk); in tcp_create_openreq_child()
505 if (sock_flag(newsk, SOCK_KEEPOPEN)) in tcp_create_openreq_child()
506 inet_csk_reset_keepalive_timer(newsk, in tcp_create_openreq_child()
551 tcp_bpf_clone(sk, newsk); in tcp_create_openreq_child()
555 return newsk; in tcp_create_openreq_child()
Dtcp_ipv4.c1534 struct sock *newsk; in tcp_v4_syn_recv_sock() local
1545 newsk = tcp_create_openreq_child(sk, req, skb); in tcp_v4_syn_recv_sock()
1546 if (!newsk) in tcp_v4_syn_recv_sock()
1549 newsk->sk_gso_type = SKB_GSO_TCPV4; in tcp_v4_syn_recv_sock()
1550 inet_sk_rx_dst_set(newsk, skb); in tcp_v4_syn_recv_sock()
1552 newtp = tcp_sk(newsk); in tcp_v4_syn_recv_sock()
1553 newinet = inet_sk(newsk); in tcp_v4_syn_recv_sock()
1555 sk_daddr_set(newsk, ireq->ir_rmt_addr); in tcp_v4_syn_recv_sock()
1556 sk_rcv_saddr_set(newsk, ireq->ir_loc_addr); in tcp_v4_syn_recv_sock()
1557 newsk->sk_bound_dev_if = ireq->ir_iif; in tcp_v4_syn_recv_sock()
[all …]
/kernel/linux/linux-5.10/net/dccp/
Dipv6.c414 struct sock *newsk; in dccp_v6_request_recv_sock() local
420 newsk = dccp_v4_request_recv_sock(sk, skb, req, dst, in dccp_v6_request_recv_sock()
422 if (newsk == NULL) in dccp_v6_request_recv_sock()
425 newdp6 = (struct dccp6_sock *)newsk; in dccp_v6_request_recv_sock()
426 newinet = inet_sk(newsk); in dccp_v6_request_recv_sock()
428 newnp = inet6_sk(newsk); in dccp_v6_request_recv_sock()
432 newnp->saddr = newsk->sk_v6_rcv_saddr; in dccp_v6_request_recv_sock()
434 inet_csk(newsk)->icsk_af_ops = &dccp_ipv6_mapped; in dccp_v6_request_recv_sock()
435 newsk->sk_backlog_rcv = dccp_v4_do_rcv; in dccp_v6_request_recv_sock()
454 dccp_sync_mss(newsk, inet_csk(newsk)->icsk_pmtu_cookie); in dccp_v6_request_recv_sock()
[all …]
Dminisocks.c87 struct sock *newsk = inet_csk_clone_lock(sk, req, GFP_ATOMIC); in dccp_create_openreq_child() local
89 if (newsk != NULL) { in dccp_create_openreq_child()
91 struct inet_connection_sock *newicsk = inet_csk(newsk); in dccp_create_openreq_child()
92 struct dccp_sock *newdp = dccp_sk(newsk); in dccp_create_openreq_child()
125 if (dccp_feat_activate_values(newsk, &dreq->dreq_featneg)) { in dccp_create_openreq_child()
126 sk_free_unlock_clone(newsk); in dccp_create_openreq_child()
129 dccp_init_xmit_timers(newsk); in dccp_create_openreq_child()
133 return newsk; in dccp_create_openreq_child()
Dipv4.c404 struct sock *newsk; in dccp_v4_request_recv_sock() local
409 newsk = dccp_create_openreq_child(sk, req, skb); in dccp_v4_request_recv_sock()
410 if (newsk == NULL) in dccp_v4_request_recv_sock()
413 newinet = inet_sk(newsk); in dccp_v4_request_recv_sock()
415 sk_daddr_set(newsk, ireq->ir_rmt_addr); in dccp_v4_request_recv_sock()
416 sk_rcv_saddr_set(newsk, ireq->ir_loc_addr); in dccp_v4_request_recv_sock()
423 if (dst == NULL && (dst = inet_csk_route_child_sock(sk, newsk, req)) == NULL) in dccp_v4_request_recv_sock()
426 sk_setup_caps(newsk, dst); in dccp_v4_request_recv_sock()
428 dccp_sync_mss(newsk, dst_mtu(dst)); in dccp_v4_request_recv_sock()
430 if (__inet_inherit_port(sk, newsk) < 0) in dccp_v4_request_recv_sock()
[all …]
/kernel/linux/linux-5.10/net/ipv6/
Dtcp_ipv6.c1232 struct sock *newsk; in tcp_v6_syn_recv_sock() local
1244 newsk = tcp_v4_syn_recv_sock(sk, skb, req, dst, in tcp_v6_syn_recv_sock()
1247 if (!newsk) in tcp_v6_syn_recv_sock()
1250 inet_sk(newsk)->pinet6 = tcp_inet6_sk(newsk); in tcp_v6_syn_recv_sock()
1252 newinet = inet_sk(newsk); in tcp_v6_syn_recv_sock()
1253 newnp = tcp_inet6_sk(newsk); in tcp_v6_syn_recv_sock()
1254 newtp = tcp_sk(newsk); in tcp_v6_syn_recv_sock()
1258 newnp->saddr = newsk->sk_v6_rcv_saddr; in tcp_v6_syn_recv_sock()
1260 inet_csk(newsk)->icsk_af_ops = &ipv6_mapped; in tcp_v6_syn_recv_sock()
1261 if (sk_is_mptcp(newsk)) in tcp_v6_syn_recv_sock()
[all …]
/kernel/linux/linux-5.10/net/core/
Dsock.c1888 struct sock *newsk; in sk_clone_lock() local
1890 newsk = sk_prot_alloc(prot, priority, sk->sk_family); in sk_clone_lock()
1891 if (!newsk) in sk_clone_lock()
1894 sock_copy(newsk, sk); in sk_clone_lock()
1896 newsk->sk_prot_creator = prot; in sk_clone_lock()
1899 if (likely(newsk->sk_net_refcnt)) { in sk_clone_lock()
1900 get_net(sock_net(newsk)); in sk_clone_lock()
1901 sock_inuse_add(sock_net(newsk), 1); in sk_clone_lock()
1903 sk_node_init(&newsk->sk_node); in sk_clone_lock()
1904 sock_lock_init(newsk); in sk_clone_lock()
[all …]
Dbpf_sk_storage.c166 bpf_sk_storage_clone_elem(struct sock *newsk, in bpf_sk_storage_clone_elem() argument
172 copy_selem = bpf_selem_alloc(smap, newsk, NULL, true); in bpf_sk_storage_clone_elem()
186 int bpf_sk_storage_clone(const struct sock *sk, struct sock *newsk) in bpf_sk_storage_clone() argument
193 RCU_INIT_POINTER(newsk->sk_bpf_storage, NULL); in bpf_sk_storage_clone()
219 copy_selem = bpf_sk_storage_clone_elem(newsk, smap, selem); in bpf_sk_storage_clone()
230 ret = bpf_local_storage_alloc(newsk, smap, copy_selem); in bpf_sk_storage_clone()
234 &newsk->sk_omem_alloc); in bpf_sk_storage_clone()
/kernel/linux/linux-5.10/net/sctp/
Dipv6.c442 static void sctp_v6_copy_ip_options(struct sock *sk, struct sock *newsk) in sctp_v6_copy_ip_options() argument
447 newnp = inet6_sk(newsk); in sctp_v6_copy_ip_options()
452 opt = ipv6_dup_options(newsk, opt); in sctp_v6_copy_ip_options()
720 struct sock *newsk; in sctp_v6_create_accept_sk() local
724 newsk = sk_alloc(sock_net(sk), PF_INET6, GFP_KERNEL, sk->sk_prot, kern); in sctp_v6_create_accept_sk()
725 if (!newsk) in sctp_v6_create_accept_sk()
728 sock_init_data(NULL, newsk); in sctp_v6_create_accept_sk()
730 sctp_copy_sock(newsk, sk, asoc); in sctp_v6_create_accept_sk()
733 newsctp6sk = (struct sctp6_sock *)newsk; in sctp_v6_create_accept_sk()
734 inet_sk(newsk)->pinet6 = &newsctp6sk->inet6; in sctp_v6_create_accept_sk()
[all …]
Dprotocol.c176 static void sctp_v4_copy_ip_options(struct sock *sk, struct sock *newsk) in sctp_v4_copy_ip_options() argument
181 newinet = inet_sk(newsk); in sctp_v4_copy_ip_options()
186 newopt = sock_kmalloc(newsk, sizeof(*inet_opt) + in sctp_v4_copy_ip_options()
578 struct sock *newsk = sk_alloc(sock_net(sk), PF_INET, GFP_KERNEL, in sctp_v4_create_accept_sk() local
582 if (!newsk) in sctp_v4_create_accept_sk()
585 sock_init_data(NULL, newsk); in sctp_v4_create_accept_sk()
587 sctp_copy_sock(newsk, sk, asoc); in sctp_v4_create_accept_sk()
588 sock_reset_flag(newsk, SOCK_ZAPPED); in sctp_v4_create_accept_sk()
590 sctp_v4_copy_ip_options(sk, newsk); in sctp_v4_create_accept_sk()
592 newinet = inet_sk(newsk); in sctp_v4_create_accept_sk()
[all …]
Dsocket.c90 static int sctp_sock_migrate(struct sock *oldsk, struct sock *newsk,
4735 struct sock *newsk = NULL; in sctp_accept() local
4766 newsk = sp->pf->create_accept_sk(sk, asoc, kern); in sctp_accept()
4767 if (!newsk) { in sctp_accept()
4775 error = sctp_sock_migrate(sk, newsk, asoc, SCTP_SOCKET_TCP); in sctp_accept()
4777 sk_common_release(newsk); in sctp_accept()
4778 newsk = NULL; in sctp_accept()
4784 return newsk; in sctp_accept()
9184 void sctp_copy_sock(struct sock *newsk, struct sock *sk, in sctp_copy_sock() argument
9192 newsk->sk_type = sk->sk_type; in sctp_copy_sock()
[all …]
/kernel/linux/linux-5.10/net/decnet/
Daf_decnet.c1066 struct sock *sk = sock->sk, *newsk; in dn_accept() local
1093 newsk = dn_alloc_sock(sock_net(sk), newsock, sk->sk_allocation, kern); in dn_accept()
1094 if (newsk == NULL) { in dn_accept()
1102 sk_dst_set(newsk, dst); in dn_accept()
1105 DN_SK(newsk)->state = DN_CR; in dn_accept()
1106 DN_SK(newsk)->addrrem = cb->src_port; in dn_accept()
1107 DN_SK(newsk)->services_rem = cb->services; in dn_accept()
1108 DN_SK(newsk)->info_rem = cb->info; in dn_accept()
1109 DN_SK(newsk)->segsize_rem = cb->segsize; in dn_accept()
1110 DN_SK(newsk)->accept_mode = DN_SK(sk)->accept_mode; in dn_accept()
[all …]
/kernel/linux/linux-5.10/drivers/net/ethernet/chelsio/inline_crypto/chtls/
Dchtls_cm.c1073 struct sock *lsk, struct sock *newsk) in inet_inherit_port() argument
1076 __inet_inherit_port(lsk, newsk); in inet_inherit_port()
1124 struct sock *newsk; in chtls_recv_sock() local
1131 newsk = tcp_create_openreq_child(lsk, oreq, cdev->askb); in chtls_recv_sock()
1132 if (!newsk) in chtls_recv_sock()
1136 dst = inet_csk_route_child_sock(lsk, newsk, oreq); in chtls_recv_sock()
1184 newsk->sk_user_data = csk; in chtls_recv_sock()
1185 newsk->sk_backlog_rcv = chtls_backlog_rcv; in chtls_recv_sock()
1187 tp = tcp_sk(newsk); in chtls_recv_sock()
1188 newinet = inet_sk(newsk); in chtls_recv_sock()
[all …]
/kernel/linux/linux-5.10/net/phonet/
Dpep.c766 struct sock *newsk = NULL; in pep_sock_accept() local
828 newsk = pep_find_pipe(&pn->hlist, &dst, pipe_handle); in pep_sock_accept()
829 if (unlikely(newsk)) { in pep_sock_accept()
830 __sock_put(newsk); in pep_sock_accept()
831 newsk = NULL; in pep_sock_accept()
837 newsk = sk_alloc(sock_net(sk), PF_PHONET, GFP_KERNEL, sk->sk_prot, in pep_sock_accept()
839 if (!newsk) { in pep_sock_accept()
845 sock_init_data(NULL, newsk); in pep_sock_accept()
846 newsk->sk_state = TCP_SYN_RECV; in pep_sock_accept()
847 newsk->sk_backlog_rcv = pipe_do_rcv; in pep_sock_accept()
[all …]
Dsocket.c298 struct sock *newsk; in pn_socket_accept() local
304 newsk = sk->sk_prot->accept(sk, flags, &err, kern); in pn_socket_accept()
305 if (!newsk) in pn_socket_accept()
308 lock_sock(newsk); in pn_socket_accept()
309 sock_graft(newsk, newsock); in pn_socket_accept()
311 release_sock(newsk); in pn_socket_accept()
/kernel/linux/linux-5.10/include/net/
Dbpf_sk_storage.h31 int bpf_sk_storage_clone(const struct sock *sk, struct sock *newsk);
41 struct sock *newsk) in bpf_sk_storage_clone() argument
/kernel/linux/linux-5.10/net/tipc/
Dtopsrv.c457 struct sock *newsk; in tipc_topsrv_accept() local
479 newsk = newsock->sk; in tipc_topsrv_accept()
480 write_lock_bh(&newsk->sk_callback_lock); in tipc_topsrv_accept()
481 newsk->sk_data_ready = tipc_conn_data_ready; in tipc_topsrv_accept()
482 newsk->sk_write_space = tipc_conn_write_space; in tipc_topsrv_accept()
483 newsk->sk_user_data = con; in tipc_topsrv_accept()
484 write_unlock_bh(&newsk->sk_callback_lock); in tipc_topsrv_accept()
487 newsk->sk_data_ready(newsk); in tipc_topsrv_accept()
/kernel/linux/common_modules/newip/third_party/linux-5.10/net/newip/
Dtcp_nip.c917 struct sock *newsk; in tcp_nip_syn_recv_sock() local
930 newsk = tcp_nip_create_openreq_child(sk, req, skb); in tcp_nip_syn_recv_sock()
931 if (!newsk) in tcp_nip_syn_recv_sock()
935 ninet_sk_rx_dst_set(newsk, skb); in tcp_nip_syn_recv_sock()
937 newtcpnipsk = (struct tcp_nip_sock *)newsk; in tcp_nip_syn_recv_sock()
940 newtp = tcp_sk(newsk); in tcp_nip_syn_recv_sock()
941 newinet = inet_sk(newsk); in tcp_nip_syn_recv_sock()
943 newsk->SK_NIP_DADDR = ireq->IR_NIP_RMT_ADDR; in tcp_nip_syn_recv_sock()
944 newsk->SK_NIP_RCV_SADDR = ireq->IR_NIP_LOC_ADDR; in tcp_nip_syn_recv_sock()
948 inet_csk(newsk)->icsk_ext_hdr_len = 0; in tcp_nip_syn_recv_sock()
[all …]
/kernel/linux/linux-5.10/security/selinux/include/
Dnetlabel.h46 void selinux_netlbl_sctp_sk_clone(struct sock *sk, struct sock *newsk);
116 struct sock *newsk) in selinux_netlbl_sctp_sk_clone() argument
/kernel/linux/linux-5.10/net/llc/
Dllc_conn.c752 struct sock *newsk = llc_sk_alloc(sock_net(sk), sk->sk_family, GFP_ATOMIC, in llc_create_incoming_sock() local
756 if (!newsk) in llc_create_incoming_sock()
758 newllc = llc_sk(newsk); in llc_create_incoming_sock()
763 llc_sap_add_socket(llc->sap, newsk); in llc_create_incoming_sock()
766 return newsk; in llc_create_incoming_sock()
793 struct sock *newsk = llc_create_incoming_sock(sk, skb->dev, in llc_conn_handler() local
795 if (!newsk) in llc_conn_handler()
797 skb_set_owner_r(skb, newsk); in llc_conn_handler()
Daf_llc.c697 struct sock *sk = sock->sk, *newsk; in llc_ui_accept() local
724 newsk = skb->sk; in llc_ui_accept()
726 llc_ui_sk_init(newsock, newsk); in llc_ui_accept()
727 sock_reset_flag(newsk, SOCK_ZAPPED); in llc_ui_accept()
728 newsk->sk_state = TCP_ESTABLISHED; in llc_ui_accept()
731 newllc = llc_sk(newsk); in llc_ui_accept()
/kernel/linux/linux-5.10/net/unix/
Daf_unix.c1257 struct sock *newsk = NULL; in unix_stream_connect() local
1284 newsk = unix_create1(sock_net(sk), NULL, 0); in unix_stream_connect()
1285 if (newsk == NULL) in unix_stream_connect()
1289 skb = sock_wmalloc(newsk, 1, 0, GFP_KERNEL); in unix_stream_connect()
1364 err = security_unix_stream_connect(sk, other, newsk); in unix_stream_connect()
1373 unix_peer(newsk) = sk; in unix_stream_connect()
1374 newsk->sk_state = TCP_ESTABLISHED; in unix_stream_connect()
1375 newsk->sk_type = sk->sk_type; in unix_stream_connect()
1376 init_peercred(newsk); in unix_stream_connect()
1377 newu = unix_sk(newsk); in unix_stream_connect()
[all …]
/kernel/linux/linux-5.10/include/linux/
Dskbuff.h1908 static inline void __skb_insert(struct sk_buff *newsk, in __skb_insert() argument
1915 WRITE_ONCE(newsk->next, next); in __skb_insert()
1916 WRITE_ONCE(newsk->prev, prev); in __skb_insert()
1917 WRITE_ONCE(next->prev, newsk); in __skb_insert()
1918 WRITE_ONCE(prev->next, newsk); in __skb_insert()
2012 struct sk_buff *newsk) in __skb_queue_after() argument
2014 __skb_insert(newsk, prev, prev->next, list); in __skb_queue_after()
2017 void skb_append(struct sk_buff *old, struct sk_buff *newsk,
2022 struct sk_buff *newsk) in __skb_queue_before() argument
2024 __skb_insert(newsk, next->prev, next, list); in __skb_queue_before()
[all …]
Dsecurity.h1341 int security_unix_stream_connect(struct sock *sock, struct sock *other, struct sock *newsk);
1365 void security_sk_clone(const struct sock *sk, struct sock *newsk);
1372 void security_inet_csk_clone(struct sock *newsk,
1389 struct sock *newsk);
1394 struct sock *newsk) in security_unix_stream_connect() argument
1515 static inline void security_sk_clone(const struct sock *sk, struct sock *newsk) in security_sk_clone() argument
1539 static inline void security_inet_csk_clone(struct sock *newsk, in security_inet_csk_clone() argument
1606 struct sock *newsk) in security_sctp_sk_clone() argument

12