summaryrefslogtreecommitdiffstats
path: root/net/ipv4
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-14 16:30:59 -0500
commitb1e355a76ff17a4efa164b53df9d785d966cb54c (patch)
treea71f0fa4823aa6ee0e4885165f9257faea6f268c /net/ipv4
parentae9cd0761263007889f9cb213914c0117c6928f9 (diff)
downloadlinux-stable-b1e355a76ff17a4efa164b53df9d785d966cb54c.tar.gz
linux-stable-b1e355a76ff17a4efa164b53df9d785d966cb54c.tar.bz2
linux-stable-b1e355a76ff17a4efa164b53df9d785d966cb54c.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>
Diffstat (limited to 'net/ipv4')
-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 6e25524c6a74..dd9625cb95cd 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -2301,6 +2301,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()