diff options
Diffstat (limited to 'ssh.c')
-rw-r--r-- | ssh.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -40,7 +40,7 @@ | |||
40 | */ | 40 | */ |
41 | 41 | ||
42 | #include "includes.h" | 42 | #include "includes.h" |
43 | RCSID("$OpenBSD: ssh.c,v 1.245 2005/06/18 04:30:36 djm Exp $"); | 43 | RCSID("$OpenBSD: ssh.c,v 1.246 2005/06/25 22:47:49 djm Exp $"); |
44 | 44 | ||
45 | #include <openssl/evp.h> | 45 | #include <openssl/evp.h> |
46 | #include <openssl/err.h> | 46 | #include <openssl/err.h> |
@@ -607,6 +607,12 @@ again: | |||
607 | *p = tolower(*p); | 607 | *p = tolower(*p); |
608 | } | 608 | } |
609 | 609 | ||
610 | /* Get default port if port has not been set. */ | ||
611 | if (options.port == 0) { | ||
612 | sp = getservbyname(SSH_SERVICE_NAME, "tcp"); | ||
613 | options.port = sp ? ntohs(sp->s_port) : SSH_DEFAULT_PORT; | ||
614 | } | ||
615 | |||
610 | if (options.proxy_command != NULL && | 616 | if (options.proxy_command != NULL && |
611 | strcmp(options.proxy_command, "none") == 0) | 617 | strcmp(options.proxy_command, "none") == 0) |
612 | options.proxy_command = NULL; | 618 | options.proxy_command = NULL; |
@@ -627,12 +633,6 @@ again: | |||
627 | if (options.control_path != NULL) | 633 | if (options.control_path != NULL) |
628 | control_client(options.control_path); | 634 | control_client(options.control_path); |
629 | 635 | ||
630 | /* Get default port if port has not been set. */ | ||
631 | if (options.port == 0) { | ||
632 | sp = getservbyname(SSH_SERVICE_NAME, "tcp"); | ||
633 | options.port = sp ? ntohs(sp->s_port) : SSH_DEFAULT_PORT; | ||
634 | } | ||
635 | |||
636 | /* Open a connection to the remote host. */ | 636 | /* Open a connection to the remote host. */ |
637 | if (ssh_connect(host, &hostaddr, options.port, | 637 | if (ssh_connect(host, &hostaddr, options.port, |
638 | options.address_family, options.connection_attempts, | 638 | options.address_family, options.connection_attempts, |