Lines Matching refs:newsk
90 static int sctp_sock_migrate(struct sock *oldsk, struct sock *newsk,
4840 struct sock *newsk = NULL; in sctp_accept() local
4871 newsk = sp->pf->create_accept_sk(sk, asoc, kern); in sctp_accept()
4872 if (!newsk) { in sctp_accept()
4880 error = sctp_sock_migrate(sk, newsk, asoc, SCTP_SOCKET_TCP); in sctp_accept()
4882 sk_common_release(newsk); in sctp_accept()
4883 newsk = NULL; in sctp_accept()
4889 return newsk; in sctp_accept()
9413 void sctp_copy_sock(struct sock *newsk, struct sock *sk, in sctp_copy_sock() argument
9420 newsk->sk_type = sk->sk_type; in sctp_copy_sock()
9421 newsk->sk_bound_dev_if = sk->sk_bound_dev_if; in sctp_copy_sock()
9422 newsk->sk_flags = sk->sk_flags; in sctp_copy_sock()
9423 newsk->sk_tsflags = sk->sk_tsflags; in sctp_copy_sock()
9424 newsk->sk_no_check_tx = sk->sk_no_check_tx; in sctp_copy_sock()
9425 newsk->sk_no_check_rx = sk->sk_no_check_rx; in sctp_copy_sock()
9426 newsk->sk_reuse = sk->sk_reuse; in sctp_copy_sock()
9427 sctp_sk(newsk)->reuse = sp->reuse; in sctp_copy_sock()
9429 newsk->sk_shutdown = sk->sk_shutdown; in sctp_copy_sock()
9430 newsk->sk_destruct = sctp_destruct_sock; in sctp_copy_sock()
9431 newsk->sk_family = sk->sk_family; in sctp_copy_sock()
9432 newsk->sk_protocol = IPPROTO_SCTP; in sctp_copy_sock()
9433 newsk->sk_backlog_rcv = sk->sk_prot->backlog_rcv; in sctp_copy_sock()
9434 newsk->sk_sndbuf = sk->sk_sndbuf; in sctp_copy_sock()
9435 newsk->sk_rcvbuf = sk->sk_rcvbuf; in sctp_copy_sock()
9436 newsk->sk_lingertime = sk->sk_lingertime; in sctp_copy_sock()
9437 newsk->sk_rcvtimeo = sk->sk_rcvtimeo; in sctp_copy_sock()
9438 newsk->sk_sndtimeo = sk->sk_sndtimeo; in sctp_copy_sock()
9439 newsk->sk_rxhash = sk->sk_rxhash; in sctp_copy_sock()
9441 newinet = inet_sk(newsk); in sctp_copy_sock()
9459 if (newsk->sk_flags & SK_FLAGS_TIMESTAMP) in sctp_copy_sock()
9465 security_sctp_sk_clone(asoc, sk, newsk); in sctp_copy_sock()
9481 static int sctp_sock_migrate(struct sock *oldsk, struct sock *newsk, in sctp_sock_migrate() argument
9486 struct sctp_sock *newsp = sctp_sk(newsk); in sctp_sock_migrate()
9497 newsk->sk_sndbuf = oldsk->sk_sndbuf; in sctp_sock_migrate()
9498 newsk->sk_rcvbuf = oldsk->sk_rcvbuf; in sctp_sock_migrate()
9500 sctp_copy_descendant(newsk, oldsk); in sctp_sock_migrate()
9513 sk_add_bind_node(newsk, &pp->owner); in sctp_sock_migrate()
9514 sctp_sk(newsk)->bind_hash = pp; in sctp_sock_migrate()
9515 inet_sk(newsk)->inet_num = inet_sk(oldsk)->inet_num; in sctp_sock_migrate()
9545 __skb_queue_tail(&newsk->sk_receive_queue, skb); in sctp_sock_migrate()
9546 sctp_skb_set_owner_r_frag(skb, newsk); in sctp_sock_migrate()
9556 atomic_set(&sctp_sk(newsk)->pd_mode, assoc->ulpq.pd_mode); in sctp_sock_migrate()
9565 queue = &newsk->sk_receive_queue; in sctp_sock_migrate()
9575 sctp_skb_set_owner_r_frag(skb, newsk); in sctp_sock_migrate()
9587 sctp_for_each_rx_skb(assoc, newsk, sctp_skb_set_owner_r_frag); in sctp_sock_migrate()
9604 lock_sock_nested(newsk, SINGLE_DEPTH_NESTING); in sctp_sock_migrate()
9606 sctp_assoc_migrate(assoc, newsk); in sctp_sock_migrate()
9612 if (sctp_state(assoc, CLOSED) && sctp_style(newsk, TCP)) { in sctp_sock_migrate()
9613 inet_sk_set_state(newsk, SCTP_SS_CLOSED); in sctp_sock_migrate()
9614 newsk->sk_shutdown |= RCV_SHUTDOWN; in sctp_sock_migrate()
9616 inet_sk_set_state(newsk, SCTP_SS_ESTABLISHED); in sctp_sock_migrate()
9619 release_sock(newsk); in sctp_sock_migrate()