summaryrefslogtreecommitdiff
path: root/usr.bin/ssh/packet.c
diff options
context:
space:
mode:
authorMarkus Friedl <markus@cvs.openbsd.org>2020-03-06 18:20:45 +0000
committerMarkus Friedl <markus@cvs.openbsd.org>2020-03-06 18:20:45 +0000
commit7579b02d5236270cf8e8cc66c2f8d00a757d0ca5 (patch)
treecfe87fe8e1aa79b7b9a8a6fb5b74940b54f09f56 /usr.bin/ssh/packet.c
parentebf4b255cc7d184f536940c3a221598f85c781bd (diff)
consistently check packet_timeout_ms against 0; ok djm
Diffstat (limited to 'usr.bin/ssh/packet.c')
-rw-r--r--usr.bin/ssh/packet.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.bin/ssh/packet.c b/usr.bin/ssh/packet.c
index 245bfc689ae..df65b7c71ce 100644
--- a/usr.bin/ssh/packet.c
+++ b/usr.bin/ssh/packet.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: packet.c,v 1.290 2020/01/30 07:20:05 djm Exp $ */
+/* $OpenBSD: packet.c,v 1.291 2020/03/06 18:20:44 markus Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1340,7 +1340,7 @@ ssh_packet_read_seqnr(struct ssh *ssh, u_char *typep, u_int32_t *seqnr_p)
}
/* Wait for some data to arrive. */
for (;;) {
- if (state->packet_timeout_ms != -1) {
+ if (state->packet_timeout_ms > 0) {
ms_to_timeval(&timeout, ms_remain);
monotime_tv(&start);
}
@@ -1351,7 +1351,7 @@ ssh_packet_read_seqnr(struct ssh *ssh, u_char *typep, u_int32_t *seqnr_p)
r = SSH_ERR_SYSTEM_ERROR;
goto out;
}
- if (state->packet_timeout_ms == -1)
+ if (state->packet_timeout_ms <= 0)
continue;
ms_subtract_diff(&start, &ms_remain);
if (ms_remain <= 0) {
@@ -1987,7 +1987,7 @@ ssh_packet_write_wait(struct ssh *ssh)
timeoutp = &timeout;
}
for (;;) {
- if (state->packet_timeout_ms != -1) {
+ if (state->packet_timeout_ms > 0) {
ms_to_timeval(&timeout, ms_remain);
monotime_tv(&start);
}
@@ -1996,7 +1996,7 @@ ssh_packet_write_wait(struct ssh *ssh)
break;
if (errno != EAGAIN && errno != EINTR)
break;
- if (state->packet_timeout_ms == -1)
+ if (state->packet_timeout_ms <= 0)
continue;
ms_subtract_diff(&start, &ms_remain);
if (ms_remain <= 0) {