From: Yuchung Cheng Subject: [PATCH net 1/3] tcp: fix off-by-one bug on aborting window-probing socket Date: Wed, 28 Nov 2018 16:06:43 -0800 Message-ID: <20181129000645.163425-2-ycheng@google.com> References: <20181129000645.163425-1-ycheng@google.com> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Cc: netdev@vger.kernel.org, edumazet@google.com, ncardwell@google.com, Yuchung Cheng To: davem@davemloft.net Return-path: Received: from mail-pg1-f193.google.com ([209.85.215.193]:33302 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726617AbeK2LKs (ORCPT ); Thu, 29 Nov 2018 06:10:48 -0500 Received: by mail-pg1-f193.google.com with SMTP id z11so67554pgu.0 for ; Wed, 28 Nov 2018 16:07:24 -0800 (PST) In-Reply-To: <20181129000645.163425-1-ycheng@google.com> Sender: netdev-owner@vger.kernel.org List-ID: Previously there is an off-by-one bug on determining when to abort a stalled window-probing socket. This patch fixes that so it is consistent with tcp_write_timeout(). Signed-off-by: Yuchung Cheng Signed-off-by: Eric Dumazet Signed-off-by: Neal Cardwell --- net/ipv4/tcp_timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c index 5f8b6d3cd855..94d858c604f6 100644 --- a/net/ipv4/tcp_timer.c +++ b/net/ipv4/tcp_timer.c @@ -376,7 +376,7 @@ static void tcp_probe_timer(struct sock *sk) return; } - if (icsk->icsk_probes_out > max_probes) { + if (icsk->icsk_probes_out >= max_probes) { abort: tcp_write_err(sk); } else { /* Only send another probe if we didn't close things up. */ -- 2.20.0.rc0.387.gc7a69e6b6c-goog