]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
tcp: fix off-by-one bug on aborting window-probing socket
authorYuchung Cheng <ycheng@google.com>
Thu, 29 Nov 2018 00:06:43 +0000 (16:06 -0800)
committerMarcelo Henrique Cerri <marcelo.cerri@canonical.com>
Fri, 17 Jan 2020 17:22:18 +0000 (14:22 -0300)
BugLink: https://bugs.launchpad.net/bugs/1857158
[ 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 <ycheng@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
net/ipv4/tcp_timer.c

index e201906a7913d5a50066fe28f66b9c5bafb024e0..27e0cff5f83a704c28c5623b952a4561de66c60f 100644 (file)
@@ -361,7 +361,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. */