From: Eric Dumazet Subject: [PATCH net] tcp: clear tp->retrans_stamp in tcp_finish_connect() Date: Wed, 19 Dec 2018 13:50:08 -0800 Message-ID: <20181219215008.58185-1-edumazet@google.com> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Cc: netdev , Eric Dumazet , Soheil Hassas Yeganeh , Neal Cardwell , Yuchung Cheng , Eric Dumazet To: "David S . Miller" Return-path: Received: from mail-pg1-f195.google.com ([209.85.215.195]:35285 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728687AbeLSVuM (ORCPT ); Wed, 19 Dec 2018 16:50:12 -0500 Received: by mail-pg1-f195.google.com with SMTP id s198so10038288pgs.2 for ; Wed, 19 Dec 2018 13:50:11 -0800 (PST) Sender: netdev-owner@vger.kernel.org List-ID: 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 Acked-by: Soheil Hassas Yeganeh --- 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