diff options
author | Eric Dumazet <edumazet@google.com> | 2019-01-17 14:23:39 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-01-18 01:19:05 -0500 |
commit | 5c701549c9a653a4335dbb2aecb4935de442b87d (patch) | |
tree | 79853fe73968b8f47942df6abdae610424f1e127 | |
parent | 5d836764620dfa3f243bdf5a678db300341195ef (diff) |
tcp: move retrans_out, sacked_out, tlp_high_seq, last_oow_ack_time init to tcp_disconnect()
If we make sure all listeners have these fields cleared, then a clone
will also inherit zero values.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/ipv4/tcp.c | 4 | ||||
-rw-r--r-- | net/ipv4/tcp_minisocks.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 3f99ad92eaed..551ad8604bea 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c | |||
@@ -2605,6 +2605,10 @@ int tcp_disconnect(struct sock *sk, int flags) | |||
2605 | tp->duplicate_sack[0].end_seq = 0; | 2605 | tp->duplicate_sack[0].end_seq = 0; |
2606 | tp->dsack_dups = 0; | 2606 | tp->dsack_dups = 0; |
2607 | tp->reord_seen = 0; | 2607 | tp->reord_seen = 0; |
2608 | tp->retrans_out = 0; | ||
2609 | tp->sacked_out = 0; | ||
2610 | tp->tlp_high_seq = 0; | ||
2611 | tp->last_oow_ack_time = 0; | ||
2608 | 2612 | ||
2609 | /* Clean up fastopen related fields */ | 2613 | /* Clean up fastopen related fields */ |
2610 | tcp_free_fastopen_req(tp); | 2614 | tcp_free_fastopen_req(tp); |
diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c index 2747aa72b8e2..29fba13849a7 100644 --- a/net/ipv4/tcp_minisocks.c +++ b/net/ipv4/tcp_minisocks.c | |||
@@ -482,12 +482,8 @@ struct sock *tcp_create_openreq_child(const struct sock *sk, | |||
482 | minmax_reset(&newtp->rtt_min, tcp_jiffies32, ~0U); | 482 | minmax_reset(&newtp->rtt_min, tcp_jiffies32, ~0U); |
483 | newicsk->icsk_ack.lrcvtime = tcp_jiffies32; | 483 | newicsk->icsk_ack.lrcvtime = tcp_jiffies32; |
484 | 484 | ||
485 | newtp->retrans_out = 0; | ||
486 | newtp->sacked_out = 0; | ||
487 | newtp->tlp_high_seq = 0; | ||
488 | newtp->lsndtime = tcp_jiffies32; | 485 | newtp->lsndtime = tcp_jiffies32; |
489 | newsk->sk_txhash = treq->txhash; | 486 | newsk->sk_txhash = treq->txhash; |
490 | newtp->last_oow_ack_time = 0; | ||
491 | newtp->total_retrans = req->num_retrans; | 487 | newtp->total_retrans = req->num_retrans; |
492 | 488 | ||
493 | /* There's a bubble in the pipe until at least the first ACK. */ | 489 | /* There's a bubble in the pipe until at least the first ACK. */ |