Lines Matching refs:newsk
442 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()
715 struct sock *newsk; in sctp_v6_create_accept_sk() local
719 newsk = sk_alloc(sock_net(sk), PF_INET6, GFP_KERNEL, sk->sk_prot, kern); in sctp_v6_create_accept_sk()
720 if (!newsk) in sctp_v6_create_accept_sk()
723 sock_init_data(NULL, newsk); in sctp_v6_create_accept_sk()
725 sctp_copy_sock(newsk, sk, asoc); in sctp_v6_create_accept_sk()
728 newsctp6sk = (struct sctp6_sock *)newsk; in sctp_v6_create_accept_sk()
729 inet_sk(newsk)->pinet6 = &newsctp6sk->inet6; in sctp_v6_create_accept_sk()
731 sctp_sk(newsk)->v4mapped = sctp_sk(sk)->v4mapped; in sctp_v6_create_accept_sk()
733 newnp = inet6_sk(newsk); in sctp_v6_create_accept_sk()
740 sctp_v6_copy_ip_options(sk, newsk); in sctp_v6_create_accept_sk()
745 sctp_v6_to_sk_daddr(&asoc->peer.primary_addr, newsk); in sctp_v6_create_accept_sk()
747 newsk->sk_v6_rcv_saddr = sk->sk_v6_rcv_saddr; in sctp_v6_create_accept_sk()
749 sk_refcnt_debug_inc(newsk); in sctp_v6_create_accept_sk()
751 if (newsk->sk_prot->init(newsk)) { in sctp_v6_create_accept_sk()
752 sk_common_release(newsk); in sctp_v6_create_accept_sk()
753 newsk = NULL; in sctp_v6_create_accept_sk()
757 return newsk; in sctp_v6_create_accept_sk()