tcp: clear tp->total_retrans in tcp_disconnect()
Subsystems (3)
PATCH 1/1 tcp: clear tp->total_retrans in tcp_disconnect()
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 <[email protected]>
Cc SeongJae Park <[email protected]>
--- net/ipv4/tcp.c | 1 + 1 file changed, 1 insertion(+)
net/ipv4/tcp.c +1 -0
@@ -2626,6 +2626,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()
Signature · 1 line
2.25.0.341.g760bfbb309-goog
Quoted 16 lines · On Fri, 31 Jan 2020 09:14:47 -0800 Eric Dumazet <[email protected]> wrote:
total_retransneeds to be cleared intcp_disconnect().
tcp_disconnect()is rarely used, but it is worth fixing it.Fixes 1da177e4c3f4 ("Linux-2.6.12-rc2")Signed-off-by Eric Dumazet <[email protected]>Cc SeongJae Park <[email protected]>--- net/ipv4/tcp.c | 1 + 1 file changed, 1 insertion(+)net/ipv4/tcp.c +0
-0
net/ipv4/tcp.c int tcp_disconnect(struct sock *sk, int flags) · line 2632
Quoted 7 lines
net/ipv4/tcp.c +1
-0@@ -2626,6 +2626,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()
Reviewed-by SeongJae Park <[email protected]>
Quoted 2 lines
Signature · 1 line
2.25.0.341.g760bfbb309-goog