From: Eric Dumazet Date: Fri, 31 Jan 2020 18:32:41 +0000 (-0800) Subject: tcp: clear tp->data_segs{in|out} in tcp_disconnect() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=db7ffee6f3eb3683cdcaeddecc0a630a14546fe3;p=linux.git tcp: clear tp->data_segs{in|out} in tcp_disconnect() tp->data_segs_in and tp->data_segs_out need to be cleared in tcp_disconnect(). tcp_disconnect() is rarely used, but it is worth fixing it. Fixes: a44d6eacdaf5 ("tcp: Add RFC4898 tcpEStatsPerfDataSegsOut/In") Signed-off-by: Eric Dumazet Cc: Martin KaFai Lau Cc: Yuchung Cheng Cc: Neal Cardwell Acked-by: Neal Cardwell Signed-off-by: Jakub Kicinski --- diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index a8ffdfb61f422..3b601823f69a9 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -2643,6 +2643,8 @@ int tcp_disconnect(struct sock *sk, int flags) tp->bytes_acked = 0; tp->bytes_received = 0; tp->bytes_retrans = 0; + tp->data_segs_in = 0; + tp->data_segs_out = 0; tp->duplicate_sack[0].start_seq = 0; tp->duplicate_sack[0].end_seq = 0; tp->dsack_dups = 0;