Lines Matching refs:newsk
490 static void sctp_v6_copy_ip_options(struct sock *sk, struct sock *newsk) in sctp_v6_copy_ip_options() argument
495 newnp = inet6_sk(newsk); in sctp_v6_copy_ip_options()
500 opt = ipv6_dup_options(newsk, opt); in sctp_v6_copy_ip_options()
768 struct sock *newsk; in sctp_v6_create_accept_sk() local
772 newsk = sk_alloc(sock_net(sk), PF_INET6, GFP_KERNEL, sk->sk_prot, kern); in sctp_v6_create_accept_sk()
773 if (!newsk) in sctp_v6_create_accept_sk()
776 sock_init_data(NULL, newsk); in sctp_v6_create_accept_sk()
778 sctp_copy_sock(newsk, sk, asoc); in sctp_v6_create_accept_sk()
781 newsctp6sk = (struct sctp6_sock *)newsk; in sctp_v6_create_accept_sk()
782 inet_sk(newsk)->pinet6 = &newsctp6sk->inet6; in sctp_v6_create_accept_sk()
784 sctp_sk(newsk)->v4mapped = sctp_sk(sk)->v4mapped; in sctp_v6_create_accept_sk()
786 newnp = inet6_sk(newsk); in sctp_v6_create_accept_sk()
793 sctp_v6_copy_ip_options(sk, newsk); in sctp_v6_create_accept_sk()
798 sctp_v6_to_sk_daddr(&asoc->peer.primary_addr, newsk); in sctp_v6_create_accept_sk()
800 newsk->sk_v6_rcv_saddr = sk->sk_v6_rcv_saddr; in sctp_v6_create_accept_sk()
802 sk_refcnt_debug_inc(newsk); in sctp_v6_create_accept_sk()
804 if (newsk->sk_prot->init(newsk)) { in sctp_v6_create_accept_sk()
805 sk_common_release(newsk); in sctp_v6_create_accept_sk()
806 newsk = NULL; in sctp_v6_create_accept_sk()
810 return newsk; in sctp_v6_create_accept_sk()