Skip to content

Commit 784f834

Browse files
edumazetkuba-moo
authored andcommitted
tcp: clear tp->segs_{in|out} in tcp_disconnect()
tp->segs_in and tp->segs_out need to be cleared in tcp_disconnect(). tcp_disconnect() is rarely used, but it is worth fixing it. Fixes: 2efd055 ("tcp: add tcpi_segs_in and tcpi_segs_out to tcp_info") Signed-off-by: Eric Dumazet <[email protected]> Cc: Marcelo Ricardo Leitner <[email protected]> Cc: Yuchung Cheng <[email protected]> Cc: Neal Cardwell <[email protected]> Acked-by: Neal Cardwell <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
1 parent db7ffee commit 784f834

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

net/ipv4/tcp.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2639,6 +2639,8 @@ int tcp_disconnect(struct sock *sk, int flags)
26392639
sk->sk_rx_dst = NULL;
26402640
tcp_saved_syn_free(tp);
26412641
tp->compressed_ack = 0;
2642+
tp->segs_in = 0;
2643+
tp->segs_out = 0;
26422644
tp->bytes_sent = 0;
26432645
tp->bytes_acked = 0;
26442646
tp->bytes_received = 0;

0 commit comments

Comments
 (0)