summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2020-01-31 09:14:47 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-02-11 04:33:53 -0800
commit4206e664b120c957af7df7a21fd192b9616078ea (patch)
tree9b65572020b1c21174fcace1f65e2df2f92d3046
parente7ec10b4ea8f6dbc19e8377b1064f4be3f630f3e (diff)
downloadlinux-stable-4206e664b120c957af7df7a21fd192b9616078ea.tar.gz
linux-stable-4206e664b120c957af7df7a21fd192b9616078ea.tar.bz2
linux-stable-4206e664b120c957af7df7a21fd192b9616078ea.zip
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 <edumazet@google.com> Cc: SeongJae Park <sjpark@amazon.de> Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--net/ipv4/tcp.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index e80eb1788f80..7b556a0cda1b 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()