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)
committerDavid S. Miller <davem@davemloft.net>
Sat, 1 Dec 2018 01:22:41 +0000 (17:22 -0800)
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>
net/ipv4/tcp_timer.c

index 091c53925e4da6b2b154d166682a0ac0aefd7ecb..25efdae4368a307ce0332366402e05e97f1a0e47 100644 (file)
@@ -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. */