Lines Matching refs:newsk
434 static void sctp_v6_copy_ip_options(struct sock *sk, struct sock *newsk) in sctp_v6_copy_ip_options() argument
439 newnp = inet6_sk(newsk); in sctp_v6_copy_ip_options()
444 opt = ipv6_dup_options(newsk, opt); in sctp_v6_copy_ip_options()
707 struct sock *newsk; in sctp_v6_create_accept_sk() local
711 newsk = sk_alloc(sock_net(sk), PF_INET6, GFP_KERNEL, sk->sk_prot, kern); in sctp_v6_create_accept_sk()
712 if (!newsk) in sctp_v6_create_accept_sk()
715 sock_init_data(NULL, newsk); in sctp_v6_create_accept_sk()
717 sctp_copy_sock(newsk, sk, asoc); in sctp_v6_create_accept_sk()
720 newsctp6sk = (struct sctp6_sock *)newsk; in sctp_v6_create_accept_sk()
721 inet_sk(newsk)->pinet6 = &newsctp6sk->inet6; in sctp_v6_create_accept_sk()
723 sctp_sk(newsk)->v4mapped = sctp_sk(sk)->v4mapped; in sctp_v6_create_accept_sk()
725 newnp = inet6_sk(newsk); in sctp_v6_create_accept_sk()
732 sctp_v6_copy_ip_options(sk, newsk); in sctp_v6_create_accept_sk()
737 sctp_v6_to_sk_daddr(&asoc->peer.primary_addr, newsk); in sctp_v6_create_accept_sk()
739 newsk->sk_v6_rcv_saddr = sk->sk_v6_rcv_saddr; in sctp_v6_create_accept_sk()
741 sk_refcnt_debug_inc(newsk); in sctp_v6_create_accept_sk()
743 if (newsk->sk_prot->init(newsk)) { in sctp_v6_create_accept_sk()
744 sk_common_release(newsk); in sctp_v6_create_accept_sk()
745 newsk = NULL; in sctp_v6_create_accept_sk()
749 return newsk; in sctp_v6_create_accept_sk()