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: v4.19.103~178 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4206e664b120c957af7df7a21fd192b9616078ea;p=platform%2Fkernel%2Flinux-rpi.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 e80eb17..7b556a0 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -2592,6 +2592,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()