summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/sshconnect.c
diff options
context:
space:
mode:
authordtucker <dtucker@openbsd.org>2019-02-01 03:52:23 +0000
committerdtucker <dtucker@openbsd.org>2019-02-01 03:52:23 +0000
commit8e123a9e8a4102d6b7351eb76de7dc28caf00b73 (patch)
tree566621740aea18dbaae9c3179a5e5846c7c70cf6 /usr.bin/ssh/sshconnect.c
parentFix gdb can handle prologues which has the retguard and teach gdb that (diff)
downloadwireguard-openbsd-8e123a9e8a4102d6b7351eb76de7dc28caf00b73.tar.xz
wireguard-openbsd-8e123a9e8a4102d6b7351eb76de7dc28caf00b73.zip
Save connection timeout and restore for 2nd and subsequent attempts,
preventing them from having no timeout. bz#2918, ok djm@
Diffstat (limited to '')
-rw-r--r--usr.bin/ssh/sshconnect.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/ssh/sshconnect.c b/usr.bin/ssh/sshconnect.c
index e8fb1e1efae..585375d5c6e 100644
--- a/usr.bin/ssh/sshconnect.c
+++ b/usr.bin/ssh/sshconnect.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshconnect.c,v 1.312 2019/01/24 17:00:29 dtucker Exp $ */
+/* $OpenBSD: sshconnect.c,v 1.313 2019/02/01 03:52:23 dtucker Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -433,7 +433,7 @@ ssh_connect_direct(struct ssh *ssh, const char *host, struct addrinfo *aitop,
struct sockaddr_storage *hostaddr, u_short port, int family,
int connection_attempts, int *timeout_ms, int want_keepalive)
{
- int on = 1;
+ int on = 1, saved_timeout_ms = *timeout_ms;
int oerrno, sock = -1, attempt;
char ntop[NI_MAXHOST], strport[NI_MAXSERV];
struct addrinfo *ai;
@@ -477,6 +477,7 @@ ssh_connect_direct(struct ssh *ssh, const char *host, struct addrinfo *aitop,
continue;
}
+ *timeout_ms = saved_timeout_ms;
if (timeout_connect(sock, ai->ai_addr, ai->ai_addrlen,
timeout_ms) >= 0) {
/* Successful connection. */