summaryrefslogtreecommitdiff
path: root/sshconnect.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2005-01-20 11:00:46 +1100
committerDarren Tucker <dtucker@zip.com.au>2005-01-20 11:00:46 +1100
commitb2161e37f5fb13ffaa3f70ad436ecec2ec13bfc4 (patch)
tree329d98a10e2a5fbc5b58af83f6b2f1559132eabd /sshconnect.c
parent0f3832322230ebc4b0fe5a2aca5cf9aaa8b0c3c1 (diff)
- markus@cvs.openbsd.org 2005/01/05 08:51:32
[sshconnect.c] remove dead code, log connect() failures with level error, ok djm@
Diffstat (limited to 'sshconnect.c')
-rw-r--r--sshconnect.c20
1 files changed, 3 insertions, 17 deletions
diff --git a/sshconnect.c b/sshconnect.c
index 11008e544..33ec4753a 100644
--- a/sshconnect.c
+++ b/sshconnect.c
@@ -13,7 +13,7 @@
13 */ 13 */
14 14
15#include "includes.h" 15#include "includes.h"
16RCSID("$OpenBSD: sshconnect.c,v 1.158 2004/06/21 17:36:31 avsm Exp $"); 16RCSID("$OpenBSD: sshconnect.c,v 1.159 2005/01/05 08:51:32 markus Exp $");
17 17
18#include <openssl/bn.h> 18#include <openssl/bn.h>
19 19
@@ -297,12 +297,6 @@ timeout_connect(int sockfd, const struct sockaddr *serv_addr,
297 * second). If proxy_command is non-NULL, it specifies the command (with %h 297 * second). If proxy_command is non-NULL, it specifies the command (with %h
298 * and %p substituted for host and port, respectively) to use to contact 298 * and %p substituted for host and port, respectively) to use to contact
299 * the daemon. 299 * the daemon.
300 * Return values:
301 * 0 for OK
302 * ECONNREFUSED if we got a "Connection Refused" by the peer on any address
303 * ECONNABORTED if we failed without a "Connection refused"
304 * Suitable error messages for the connection failure will already have been
305 * printed.
306 */ 300 */
307int 301int
308ssh_connect(const char *host, struct sockaddr_storage * hostaddr, 302ssh_connect(const char *host, struct sockaddr_storage * hostaddr,
@@ -315,12 +309,6 @@ ssh_connect(const char *host, struct sockaddr_storage * hostaddr,
315 char ntop[NI_MAXHOST], strport[NI_MAXSERV]; 309 char ntop[NI_MAXHOST], strport[NI_MAXSERV];
316 struct addrinfo hints, *ai, *aitop; 310 struct addrinfo hints, *ai, *aitop;
317 struct servent *sp; 311 struct servent *sp;
318 /*
319 * Did we get only other errors than "Connection refused" (which
320 * should block fallback to rsh and similar), or did we get at least
321 * one "Connection refused"?
322 */
323 int full_failure = 1;
324 312
325 debug2("ssh_connect: needpriv %d", needpriv); 313 debug2("ssh_connect: needpriv %d", needpriv);
326 314
@@ -381,8 +369,6 @@ ssh_connect(const char *host, struct sockaddr_storage * hostaddr,
381 memcpy(hostaddr, ai->ai_addr, ai->ai_addrlen); 369 memcpy(hostaddr, ai->ai_addr, ai->ai_addrlen);
382 break; 370 break;
383 } else { 371 } else {
384 if (errno == ECONNREFUSED)
385 full_failure = 0;
386 debug("connect to address %s port %s: %s", 372 debug("connect to address %s port %s: %s",
387 ntop, strport, strerror(errno)); 373 ntop, strport, strerror(errno));
388 /* 374 /*
@@ -408,9 +394,9 @@ ssh_connect(const char *host, struct sockaddr_storage * hostaddr,
408 394
409 /* Return failure if we didn't get a successful connection. */ 395 /* Return failure if we didn't get a successful connection. */
410 if (attempt >= connection_attempts) { 396 if (attempt >= connection_attempts) {
411 logit("ssh: connect to host %s port %s: %s", 397 error("ssh: connect to host %s port %s: %s",
412 host, strport, strerror(errno)); 398 host, strport, strerror(errno));
413 return full_failure ? ECONNABORTED : ECONNREFUSED; 399 return (-1);
414 } 400 }
415 401
416 debug("Connection established."); 402 debug("Connection established.");