From: Yuchung Cheng Date: Thu, 29 Nov 2018 00:06:43 +0000 (-0800) Subject: tcp: fix off-by-one bug on aborting window-probing socket X-Git-Tag: v4.19.89~100 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=85b03cfe31befc481e1da603d888517da2e30409;p=thirdparty%2Fkernel%2Fstable.git tcp: fix off-by-one bug on aborting window-probing socket [ Upstream commit 3976535af0cb9fe34a55f2ffb8d7e6b39a2f8188 ] 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 Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c index c719a41d2eba2..50b15e1c633b4 100644 --- a/net/ipv4/tcp_timer.c +++ b/net/ipv4/tcp_timer.c @@ -378,7 +378,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. */