Skip to contentSkip to conversation

tcp: clear tp->retrans_stamp in tcp_finish_connect()

PATCH In review Eric Dumazet 4 participants 4 messages Dec 19, 2018

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

PATCH 1/1 tcp: clear tp->retrans_stamp in tcp_finish_connect()

tcp_connect() does :

     tp->retrans_stamp = tcp_time_stamp(tp);

When 3WHS completes, we need to clear retrans_stamp otherwise various things can break.

This bug became more visible after commit b701a99e431d ("tcp: Add tcp_clamp_rto_to_user_timeout() helper to improve accuracy"), but predates git history.

---
 net/ipv4/tcp_input.c | 1 +
 1 file changed, 1 insertion(+)
net/ipv4/tcp_input.c +1 -0
index a9d9555a973fed4e3562a57d1a2cdadfef40dae4..6c1c79a34ea0b694d0259b3f39ac1481b81dac5a 100644
@@ -5680,6 +5680,7 @@ void tcp_finish_connect(struct sock *sk, struct sk_buff *skb)
 	 * packet.
 	 */
 	tp->lsndtime = tcp_jiffies32;
+	tp->retrans_stamp = 0;
 
 	if (sock_flag(sk, SOCK_KEEPOPEN))
 		inet_csk_reset_keepalive_timer(sk, keepalive_time_when(tp));
Signature · 1 line
2.20.0.405.gbc1bbc6f85-goog
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Eric Dumazet

tcp_connect() does :

     tp->retrans_stamp = tcp_time_stamp(tp);

When 3WHS completes, we need to clear retrans_stamp otherwise various things can break.

Quoted 7 lines

This bug became more visible after commit b701a99e431d ("tcp: Add tcp_clamp_rto_to_user_timeout() helper to improve accuracy"), but predates git history.

---

Thanks!

neal

#2 lore raw
In reply to Eric Dumazet
Quoted 7 lines · Eric Dumazet

tcp_connect() does :

     tp->retrans_stamp = tcp_time_stamp(tp);

When 3WHS completes, we need to clear retrans_stamp otherwise various things can break.

Quoted 6 lines

This bug became more visible after commit b701a99e431d ("tcp: Add tcp_clamp_rto_to_user_timeout() helper to improve accuracy"), but predates git history.

David please disregard this patch. tp->retrans_stamp is already cleared in tcp_clean_rtx_queue() when the SYN packet is removed from rtx queue.

Thanks.

maintainer
#3 lore raw

From: Eric Dumazet <[email protected]>
Date: Wed, 19 Dec 2018 15:27:19 -0800

Quoted 12 lines · Eric Dumazet
Quoted 11 lines

tcp_connect() does :

     tp->retrans_stamp = tcp_time_stamp(tp);

When 3WHS completes, we need to clear retrans_stamp otherwise various things can break.

This bug became more visible after commit b701a99e431d ("tcp: Add tcp_clamp_rto_to_user_timeout() helper to improve accuracy"), but predates git history.

Quoted 6 lines
Quoted 2 lines

David please disregard this patch. tp->retrans_stamp is already cleared in tcp_clean_rtx_queue() when the SYN packet is removed from rtx queue.

Ok.