Skip to contentSkip to conversation

tcp: clear tp->total_retrans in tcp_disconnect()

PATCH In review Eric Dumazet 2 participants 2 messages Jan 31, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

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")
Cc SeongJae Park <[email protected]>
---
 net/ipv4/tcp.c | 1 +
 1 file changed, 1 insertion(+)
net/ipv4/tcp.c +1 -0
index 484485ae74c26eb43d49d972e068bcf5d0e33d58..dd57f1e3618160c1e51d6ff54afa984292614e5c 100644
@@ -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
Reviewed-by SeongJae Park on v1 1/1
#1 lore raw
Quoted 16 lines · On Fri, 31 Jan 2020 09:14:47 -0800 Eric Dumazet <[email protected]> wrote:

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")
Cc SeongJae Park <[email protected]>
---
 net/ipv4/tcp.c | 1 +
 1 file changed, 1 insertion(+)
net/ipv4/tcp.c +0 -0
index 484485ae74c26eb43d49d972e068bcf5d0e33d58..dd57f1e3618160c1e51d6ff54afa984292614e5c 100644

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()
Quoted 2 lines
Signature · 1 line
2.25.0.341.g760bfbb309-goog