| From 92472022718ccffb1d2afc65e1d7cd0805294a66 Mon Sep 17 00:00:00 2001 |
| From: Eric Dumazet <edumazet@google.com> |
| Date: Fri, 31 Jan 2020 09:14:47 -0800 |
| Subject: [PATCH] tcp: clear tp->total_retrans in tcp_disconnect() |
| |
| commit c13c48c00a6bc1febc73902505bdec0967bd7095 upstream. |
| |
| 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: Paul Gortmaker <paul.gortmaker@windriver.com> |
| |
| diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c |
| index 05159825d0be..00f67d18dbe5 100644 |
| --- a/net/ipv4/tcp.c |
| +++ b/net/ipv4/tcp.c |
| @@ -2612,6 +2612,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() |
| -- |
| 2.7.4 |
| |