aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_minisocks.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4/tcp_minisocks.c')
-rw-r--r--net/ipv4/tcp_minisocks.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c
index 56823704eb7d..4cfbe1d1c920 100644
--- a/net/ipv4/tcp_minisocks.c
+++ b/net/ipv4/tcp_minisocks.c
@@ -600,22 +600,14 @@ out:
600 */ 600 */
601struct sock *tcp_create_openreq_child(struct sock *sk, struct request_sock *req, struct sk_buff *skb) 601struct sock *tcp_create_openreq_child(struct sock *sk, struct request_sock *req, struct sk_buff *skb)
602{ 602{
603 struct sock *newsk = sk_clone(sk, GFP_ATOMIC); 603 struct sock *newsk = inet_csk_clone(sk, req, GFP_ATOMIC);
604 604
605 if (newsk != NULL) { 605 if (newsk != NULL) {
606 struct inet_request_sock *ireq = inet_rsk(req); 606 const struct inet_request_sock *ireq = inet_rsk(req);
607 struct tcp_request_sock *treq = tcp_rsk(req); 607 struct tcp_request_sock *treq = tcp_rsk(req);
608 struct inet_sock *newinet = inet_sk(newsk); 608 struct inet_connection_sock *newicsk = inet_csk(sk);
609 struct inet_connection_sock *newicsk = inet_csk(newsk);
610 struct tcp_sock *newtp; 609 struct tcp_sock *newtp;
611 610
612 newsk->sk_state = TCP_SYN_RECV;
613 newicsk->icsk_bind_hash = NULL;
614
615 /* Clone the TCP header template */
616 newinet->dport = ireq->rmt_port;
617 newsk->sk_write_space = sk_stream_write_space;
618
619 /* Now setup tcp_sock */ 611 /* Now setup tcp_sock */
620 newtp = tcp_sk(newsk); 612 newtp = tcp_sk(newsk);
621 newtp->pred_flags = 0; 613 newtp->pred_flags = 0;
@@ -626,8 +618,6 @@ struct sock *tcp_create_openreq_child(struct sock *sk, struct request_sock *req,
626 618
627 tcp_init_wl(newtp, treq->snt_isn, treq->rcv_isn); 619 tcp_init_wl(newtp, treq->snt_isn, treq->rcv_isn);
628 620
629 newicsk->icsk_retransmits = 0;
630 newicsk->icsk_backoff = 0;
631 newtp->srtt = 0; 621 newtp->srtt = 0;
632 newtp->mdev = TCP_TIMEOUT_INIT; 622 newtp->mdev = TCP_TIMEOUT_INIT;
633 newicsk->icsk_rto = TCP_TIMEOUT_INIT; 623 newicsk->icsk_rto = TCP_TIMEOUT_INIT;
@@ -668,8 +658,6 @@ struct sock *tcp_create_openreq_child(struct sock *sk, struct request_sock *req,
668 newtp->probes_out = 0; 658 newtp->probes_out = 0;
669 newtp->rx_opt.num_sacks = 0; 659 newtp->rx_opt.num_sacks = 0;
670 newtp->urg_data = 0; 660 newtp->urg_data = 0;
671 /* Deinitialize accept_queue to trap illegal accesses. */
672 memset(&newicsk->icsk_accept_queue, 0, sizeof(newicsk->icsk_accept_queue));
673 661
674 if (sock_flag(newsk, SOCK_KEEPOPEN)) 662 if (sock_flag(newsk, SOCK_KEEPOPEN))
675 inet_csk_reset_keepalive_timer(newsk, 663 inet_csk_reset_keepalive_timer(newsk,