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()
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()
736 sctp_sk(newsk)->v4mapped = sctp_sk(sk)->v4mapped; in sctp_v6_create_accept_sk()
738 newnp = inet6_sk(newsk); in sctp_v6_create_accept_sk()
745 sctp_v6_copy_ip_options(sk, newsk); in sctp_v6_create_accept_sk()
750 sctp_v6_to_sk_daddr(&asoc->peer.primary_addr, newsk); in sctp_v6_create_accept_sk()
752 newsk->sk_v6_rcv_saddr = sk->sk_v6_rcv_saddr; in sctp_v6_create_accept_sk()
754 sk_refcnt_debug_inc(newsk); in sctp_v6_create_accept_sk()
756 if (newsk->sk_prot->init(newsk)) { in sctp_v6_create_accept_sk()
757 sk_common_release(newsk); in sctp_v6_create_accept_sk()
758 newsk = NULL; in sctp_v6_create_accept_sk()
762 return newsk; in sctp_v6_create_accept_sk()