summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2006-10-24 03:02:23 +1000
committerDamien Miller <djm@mindrot.org>2006-10-24 03:02:23 +1000
commitf4bcd10c4c9b53e7c0c2821825addaf3a13d7c1a (patch)
treef5057a64ea7acfc62d45457ec820ad7c042989b0
parent990b1a80b59eb52ae401ed28b0e3a4d5a0963661 (diff)
- markus@cvs.openbsd.org 2006/10/10 10:12:45
[sshconnect.c] sleep before retrying (not after) since sleep changes errno; fixes pr 5250; rad@twig.com; ok dtucker djm
-rw-r--r--ChangeLog6
-rw-r--r--sshconnect.c11
2 files changed, 10 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index ca25e7866..2b752ca54 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -13,6 +13,10 @@
13 [session.c] 13 [session.c]
14 xmalloc -> xcalloc that was missed previously, from portable 14 xmalloc -> xcalloc that was missed previously, from portable
15 (NB. Id sync only for portable, obviously) 15 (NB. Id sync only for portable, obviously)
16 - markus@cvs.openbsd.org 2006/10/10 10:12:45
17 [sshconnect.c]
18 sleep before retrying (not after) since sleep changes errno; fixes
19 pr 5250; rad@twig.com; ok dtucker djm
16 20
1720061018 2120061018
18 - (dtucker) OpenBSD CVS Sync 22 - (dtucker) OpenBSD CVS Sync
@@ -2554,4 +2558,4 @@
2554 OpenServer 6 and add osr5bigcrypt support so when someone migrates 2558 OpenServer 6 and add osr5bigcrypt support so when someone migrates
2555 passwords between UnixWare and OpenServer they will still work. OK dtucker@ 2559 passwords between UnixWare and OpenServer they will still work. OK dtucker@
2556 2560
2557$Id: ChangeLog,v 1.4575 2006/10/23 17:01:56 djm Exp $ 2561$Id: ChangeLog,v 1.4576 2006/10/23 17:02:23 djm Exp $
diff --git a/sshconnect.c b/sshconnect.c
index a7a4e8a96..a222233d0 100644
--- a/sshconnect.c
+++ b/sshconnect.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: sshconnect.c,v 1.199 2006/08/03 03:34:42 deraadt Exp $ */ 1/* $OpenBSD: sshconnect.c,v 1.200 2006/10/10 10:12:45 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
@@ -324,9 +324,11 @@ ssh_connect(const char *host, struct sockaddr_storage * hostaddr,
324 gai_strerror(gaierr)); 324 gai_strerror(gaierr));
325 325
326 for (attempt = 0; attempt < connection_attempts; attempt++) { 326 for (attempt = 0; attempt < connection_attempts; attempt++) {
327 if (attempt > 0) 327 if (attempt > 0) {
328 /* Sleep a moment before retrying. */
329 sleep(1);
328 debug("Trying again..."); 330 debug("Trying again...");
329 331 }
330 /* 332 /*
331 * Loop through addresses for this host, and try each one in 333 * Loop through addresses for this host, and try each one in
332 * sequence until the connection succeeds. 334 * sequence until the connection succeeds.
@@ -363,9 +365,6 @@ ssh_connect(const char *host, struct sockaddr_storage * hostaddr,
363 } 365 }
364 if (sock != -1) 366 if (sock != -1)
365 break; /* Successful connection. */ 367 break; /* Successful connection. */
366
367 /* Sleep a moment before retrying. */
368 sleep(1);
369 } 368 }
370 369
371 freeaddrinfo(aitop); 370 freeaddrinfo(aitop);