From: Eric Dumazet Date: Fri, 31 Jan 2020 17:14:47 +0000 (-0800) Subject: tcp: clear tp->total_retrans in tcp_disconnect() X-Git-Tag: v5.5.3~358 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=b9fda81bde3d2c0bcf9110a08d271956dca9d8c8;p=users%2Fdwmw2%2Flinux.git tcp: clear tp->total_retrans in tcp_disconnect() [ Upstream commit c13c48c00a6bc1febc73902505bdec0967bd7095 ] total_retrans needs to be cleared in tcp_disconnect(). tcp_disconnect() is rarely used, but it is worth fixing it. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Eric Dumazet Cc: SeongJae Park Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index a7d766e6390e2..4f1f7ec46ffc0 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -2625,6 +2625,7 @@ int tcp_disconnect(struct sock *sk, int flags) tcp_set_ca_state(sk, TCP_CA_Open); tp->is_sack_reneg = 0; tcp_clear_retrans(tp); + tp->total_retrans = 0; inet_csk_delack_init(sk); /* Initialize rcv_mss to TCP_MIN_MSS to avoid division by 0 * issue in __tcp_select_window()