summaryrefslogtreecommitdiff
path: root/packet.c
diff options
context:
space:
mode:
authordtucker@openbsd.org <dtucker@openbsd.org>2018-05-25 03:20:59 +0000
committerDamien Miller <djm@mindrot.org>2018-05-25 14:27:50 +1000
commit1da5934b860ac0378d52d3035b22b6670f6a967e (patch)
tree4065d9fd7aebb64f0b8efdfedc7c57f4c419cf43 /packet.c
parent4ef75926ef517d539f2c7aac3188b09f315c86a7 (diff)
upstream: If select() fails in ssh_packet_read_seqnr go directly to
the error path instead of trying to read from the socket on the way out, which resets errno and causes the true error to be misreported. ok djm@ OpenBSD-Commit-ID: 2614edaadbd05a957aa977728aa7a030af7c6f0a
Diffstat (limited to 'packet.c')
-rw-r--r--packet.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/packet.c b/packet.c
index 574aef60e..08a4d661c 100644
--- a/packet.c
+++ b/packet.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: packet.c,v 1.269 2017/12/18 23:13:42 djm Exp $ */ 1/* $OpenBSD: packet.c,v 1.270 2018/05/25 03:20:59 dtucker 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
@@ -1338,8 +1338,10 @@ ssh_packet_read_seqnr(struct ssh *ssh, u_char *typep, u_int32_t *seqnr_p)
1338 NULL, NULL, timeoutp)) >= 0) 1338 NULL, NULL, timeoutp)) >= 0)
1339 break; 1339 break;
1340 if (errno != EAGAIN && errno != EINTR && 1340 if (errno != EAGAIN && errno != EINTR &&
1341 errno != EWOULDBLOCK) 1341 errno != EWOULDBLOCK) {
1342 break; 1342 r = SSH_ERR_SYSTEM_ERROR;
1343 goto out;
1344 }
1343 if (state->packet_timeout_ms == -1) 1345 if (state->packet_timeout_ms == -1)
1344 continue; 1346 continue;
1345 ms_subtract_diff(&start, &ms_remain); 1347 ms_subtract_diff(&start, &ms_remain);