Skip to content

Commit

Permalink
tcp: move retrans_out, sacked_out, tlp_high_seq, last_oow_ack_time in…
Browse files Browse the repository at this point in the history
…it 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>
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Jan 18, 2019
1 parent 5d83676 commit 5c70154
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 4 additions & 0 deletions net/ipv4/tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2605,6 +2605,10 @@ int tcp_disconnect(struct sock *sk, int flags)
tp->duplicate_sack[0].end_seq = 0;
tp->dsack_dups = 0;
tp->reord_seen = 0;
tp->retrans_out = 0;
tp->sacked_out = 0;
tp->tlp_high_seq = 0;
tp->last_oow_ack_time = 0;

/* Clean up fastopen related fields */
tcp_free_fastopen_req(tp);
Expand Down
4 changes: 0 additions & 4 deletions net/ipv4/tcp_minisocks.c
Original file line number Diff line number Diff line change
Expand Up @@ -482,12 +482,8 @@ struct sock *tcp_create_openreq_child(const struct sock *sk,
minmax_reset(&newtp->rtt_min, tcp_jiffies32, ~0U);
newicsk->icsk_ack.lrcvtime = tcp_jiffies32;

newtp->retrans_out = 0;
newtp->sacked_out = 0;
newtp->tlp_high_seq = 0;
newtp->lsndtime = tcp_jiffies32;
newsk->sk_txhash = treq->txhash;
newtp->last_oow_ack_time = 0;
newtp->total_retrans = req->num_retrans;

/* There's a bubble in the pipe until at least the first ACK. */
Expand Down

0 comments on commit 5c70154

Please sign in to comment.