diff options
author | 2006-10-10 10:12:45 +0000 | |
---|---|---|
committer | 2006-10-10 10:12:45 +0000 | |
commit | 2999d2b4aadee2117511b973fa4a79f622727943 (patch) | |
tree | c7306025fc53258aaca95a42416329822355ff5b | |
parent | Minor tweaks. (diff) | |
download | wireguard-openbsd-2999d2b4aadee2117511b973fa4a79f622727943.tar.xz wireguard-openbsd-2999d2b4aadee2117511b973fa4a79f622727943.zip |
sleep before retrying (not after) since sleep changes errno; fixes
pr 5250; rad@twig.com; ok dtucker djm
-rw-r--r-- | usr.bin/ssh/sshconnect.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/usr.bin/ssh/sshconnect.c b/usr.bin/ssh/sshconnect.c index 3c58b1be636..163f00fd397 100644 --- a/usr.bin/ssh/sshconnect.c +++ b/usr.bin/ssh/sshconnect.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sshconnect.c,v 1.199 2006/08/03 03:34:42 deraadt Exp $ */ +/* $OpenBSD: sshconnect.c,v 1.200 2006/10/10 10:12:45 markus Exp $ */ /* * Author: Tatu Ylonen <ylo@cs.hut.fi> * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland @@ -311,9 +311,11 @@ ssh_connect(const char *host, struct sockaddr_storage * hostaddr, gai_strerror(gaierr)); for (attempt = 0; attempt < connection_attempts; attempt++) { - if (attempt > 0) + if (attempt > 0) { + /* Sleep a moment before retrying. */ + sleep(1); debug("Trying again..."); - + } /* * Loop through addresses for this host, and try each one in * sequence until the connection succeeds. @@ -350,9 +352,6 @@ ssh_connect(const char *host, struct sockaddr_storage * hostaddr, } if (sock != -1) break; /* Successful connection. */ - - /* Sleep a moment before retrying. */ - sleep(1); } freeaddrinfo(aitop); |