summaryrefslogtreecommitdiff
path: root/packet.c
diff options
context:
space:
mode:
Diffstat (limited to 'packet.c')
-rw-r--r--packet.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/packet.c b/packet.c
index 6d3e9172d..e7abb3416 100644
--- a/packet.c
+++ b/packet.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: packet.c,v 1.290 2020/01/30 07:20:05 djm Exp $ */ 1/* $OpenBSD: packet.c,v 1.291 2020/03/06 18:20:44 markus Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1365,7 +1365,7 @@ ssh_packet_read_seqnr(struct ssh *ssh, u_char *typep, u_int32_t *seqnr_p)
1365 } 1365 }
1366 /* Wait for some data to arrive. */ 1366 /* Wait for some data to arrive. */
1367 for (;;) { 1367 for (;;) {
1368 if (state->packet_timeout_ms != -1) { 1368 if (state->packet_timeout_ms > 0) {
1369 ms_to_timeval(&timeout, ms_remain); 1369 ms_to_timeval(&timeout, ms_remain);
1370 monotime_tv(&start); 1370 monotime_tv(&start);
1371 } 1371 }
@@ -1377,7 +1377,7 @@ ssh_packet_read_seqnr(struct ssh *ssh, u_char *typep, u_int32_t *seqnr_p)
1377 r = SSH_ERR_SYSTEM_ERROR; 1377 r = SSH_ERR_SYSTEM_ERROR;
1378 goto out; 1378 goto out;
1379 } 1379 }
1380 if (state->packet_timeout_ms == -1) 1380 if (state->packet_timeout_ms <= 0)
1381 continue; 1381 continue;
1382 ms_subtract_diff(&start, &ms_remain); 1382 ms_subtract_diff(&start, &ms_remain);
1383 if (ms_remain <= 0) { 1383 if (ms_remain <= 0) {
@@ -2014,7 +2014,7 @@ ssh_packet_write_wait(struct ssh *ssh)
2014 timeoutp = &timeout; 2014 timeoutp = &timeout;
2015 } 2015 }
2016 for (;;) { 2016 for (;;) {
2017 if (state->packet_timeout_ms != -1) { 2017 if (state->packet_timeout_ms > 0) {
2018 ms_to_timeval(&timeout, ms_remain); 2018 ms_to_timeval(&timeout, ms_remain);
2019 monotime_tv(&start); 2019 monotime_tv(&start);
2020 } 2020 }
@@ -2024,7 +2024,7 @@ ssh_packet_write_wait(struct ssh *ssh)
2024 if (errno != EAGAIN && errno != EINTR && 2024 if (errno != EAGAIN && errno != EINTR &&
2025 errno != EWOULDBLOCK) 2025 errno != EWOULDBLOCK)
2026 break; 2026 break;
2027 if (state->packet_timeout_ms == -1) 2027 if (state->packet_timeout_ms <= 0)
2028 continue; 2028 continue;
2029 ms_subtract_diff(&start, &ms_remain); 2029 ms_subtract_diff(&start, &ms_remain);
2030 if (ms_remain <= 0) { 2030 if (ms_remain <= 0) {