netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] tcp: clear tp->retrans_stamp in tcp_finish_connect()
@ 2018-12-19 21:50 Eric Dumazet
  2018-12-19 22:05 ` Neal Cardwell
  2018-12-19 23:27 ` Eric Dumazet
  0 siblings, 2 replies; 4+ messages in thread
From: Eric Dumazet @ 2018-12-19 21:50 UTC (permalink / raw)
  To: David S . Miller
  Cc: netdev, Eric Dumazet, Soheil Hassas Yeganeh, Neal Cardwell,
	Yuchung Cheng, 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.

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

Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Soheil Hassas Yeganeh <soheil@google.com>
---
 net/ipv4/tcp_input.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index a9d9555a973fed4e3562a57d1a2cdadfef40dae4..6c1c79a34ea0b694d0259b3f39ac1481b81dac5a 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -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));
-- 
2.20.0.405.gbc1bbc6f85-goog

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net] tcp: clear tp->retrans_stamp in tcp_finish_connect()
  2018-12-19 21:50 [PATCH net] tcp: clear tp->retrans_stamp in tcp_finish_connect() Eric Dumazet
@ 2018-12-19 22:05 ` Neal Cardwell
  2018-12-19 23:27 ` Eric Dumazet
  1 sibling, 0 replies; 4+ messages in thread
From: Neal Cardwell @ 2018-12-19 22:05 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: David S . Miller, netdev, Soheil Hassas Yeganeh, Yuchung Cheng,
	Eric Dumazet

On Wed, Dec 19, 2018 at 4:50 PM Eric Dumazet <edumazet@google.com> wrote:
>
> 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.
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Acked-by: Soheil Hassas Yeganeh <soheil@google.com>
> ---

Acked-by: Neal Cardwell <ncardwell@google.com>

Thanks!

neal

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net] tcp: clear tp->retrans_stamp in tcp_finish_connect()
  2018-12-19 21:50 [PATCH net] tcp: clear tp->retrans_stamp in tcp_finish_connect() Eric Dumazet
  2018-12-19 22:05 ` Neal Cardwell
@ 2018-12-19 23:27 ` Eric Dumazet
  2018-12-19 23:47   ` David Miller
  1 sibling, 1 reply; 4+ messages in thread
From: Eric Dumazet @ 2018-12-19 23:27 UTC (permalink / raw)
  To: Eric Dumazet, David S . Miller
  Cc: netdev, Soheil Hassas Yeganeh, Neal Cardwell, Yuchung Cheng



On 12/19/2018 01:50 PM, Eric Dumazet wrote:
> 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.
> 
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Acked-by: Soheil Hassas Yeganeh <soheil@google.com>


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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net] tcp: clear tp->retrans_stamp in tcp_finish_connect()
  2018-12-19 23:27 ` Eric Dumazet
@ 2018-12-19 23:47   ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2018-12-19 23:47 UTC (permalink / raw)
  To: eric.dumazet; +Cc: edumazet, netdev, soheil, ncardwell, ycheng

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Wed, 19 Dec 2018 15:27:19 -0800

> On 12/19/2018 01:50 PM, Eric Dumazet wrote:
>> 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.
>> 
>> Signed-off-by: Eric Dumazet <edumazet@google.com>
>> Acked-by: Soheil Hassas Yeganeh <soheil@google.com>
> 
> 
> 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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-12-19 23:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-19 21:50 [PATCH net] tcp: clear tp->retrans_stamp in tcp_finish_connect() Eric Dumazet
2018-12-19 22:05 ` Neal Cardwell
2018-12-19 23:27 ` Eric Dumazet
2018-12-19 23:47   ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).