Lines Matching refs:newsk

3907 	struct sock *newsk = NULL;
3938 newsk = sp->pf->create_accept_sk(sk, asoc);
3939 if (!newsk) {
3944 /* Populate the fields of the newsk from the oldsk and migrate the
3945 * asoc to the newsk.
3947 sctp_sock_migrate(sk, newsk, asoc, SCTP_SOCKET_TCP);
3952 return newsk;
4441 /* Populate the fields of the newsk from the oldsk and migrate the
4442 * asoc to the newsk.
4483 pr_debug("%s: sk:%p, newsk:%p, sd:%d\n", __func__, sk, newsock->sk,
7161 void sctp_copy_sock(struct sock *newsk, struct sock *sk,
7167 newsk->sk_type = sk->sk_type;
7168 newsk->sk_bound_dev_if = sk->sk_bound_dev_if;
7169 newsk->sk_flags = sk->sk_flags;
7170 newsk->sk_no_check_tx = sk->sk_no_check_tx;
7171 newsk->sk_no_check_rx = sk->sk_no_check_rx;
7172 newsk->sk_reuse = sk->sk_reuse;
7174 newsk->sk_shutdown = sk->sk_shutdown;
7175 newsk->sk_destruct = sctp_destruct_sock;
7176 newsk->sk_family = sk->sk_family;
7177 newsk->sk_protocol = IPPROTO_SCTP;
7178 newsk->sk_backlog_rcv = sk->sk_prot->backlog_rcv;
7179 newsk->sk_sndbuf = sk->sk_sndbuf;
7180 newsk->sk_rcvbuf = sk->sk_rcvbuf;
7181 newsk->sk_lingertime = sk->sk_lingertime;
7182 newsk->sk_rcvtimeo = sk->sk_rcvtimeo;
7183 newsk->sk_sndtimeo = sk->sk_sndtimeo;
7185 newinet = inet_sk(newsk);
7204 /* Populate the fields of the newsk from the oldsk and migrate the assoc
7205 * and its messages to the newsk.
7207 static void sctp_sock_migrate(struct sock *oldsk, struct sock *newsk,
7212 struct sctp_sock *newsp = sctp_sk(newsk);
7223 newsk->sk_sndbuf = oldsk->sk_sndbuf;
7224 newsk->sk_rcvbuf = oldsk->sk_rcvbuf;
7228 inet_sk_copy_descendant(newsk, oldsk);
7231 inet_sk_copy_descendant(newsk, oldsk);
7245 sk_add_bind_node(newsk, &pp->owner);
7246 sctp_sk(newsk)->bind_hash = pp;
7247 inet_sk(newsk)->inet_num = inet_sk(oldsk)->inet_num;
7264 __skb_queue_tail(&newsk->sk_receive_queue, skb);
7265 sctp_skb_set_owner_r_frag(skb, newsk);
7276 atomic_set(&sctp_sk(newsk)->pd_mode, assoc->ulpq.pd_mode);
7285 queue = &newsk->sk_receive_queue;
7295 sctp_skb_set_owner_r_frag(skb, newsk);
7308 sctp_skb_set_owner_r_frag(skb, newsk);
7311 sctp_skb_set_owner_r_frag(skb, newsk);
7325 * The caller has just allocated newsk so we can guarantee that other
7328 lock_sock_nested(newsk, SINGLE_DEPTH_NESTING);
7329 sctp_assoc_migrate(assoc, newsk);
7331 /* If the association on the newsk is already closed before accept()
7334 if (sctp_state(assoc, CLOSED) && sctp_style(newsk, TCP))
7335 newsk->sk_shutdown |= RCV_SHUTDOWN;
7337 newsk->sk_state = SCTP_SS_ESTABLISHED;
7338 release_sock(newsk);