summaryrefslogtreecommitdiff
path: root/ssh.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2005-06-26 08:56:31 +1000
committerDamien Miller <djm@mindrot.org>2005-06-26 08:56:31 +1000
commit7c71cc738c87905561d64eeb95ea7327917089f2 (patch)
tree92339f97888064ffbb1d910094c6abff9df8789c /ssh.c
parent8f74c8fc3216af41e466dbe7abbe8660679588ad (diff)
- djm@cvs.openbsd.org 2005/06/25 22:47:49
[ssh.c] do the default port filling code a few lines earlier, so it really does fix %p
Diffstat (limited to 'ssh.c')
-rw-r--r--ssh.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/ssh.c b/ssh.c
index 91f8559de..67af53e69 100644
--- a/ssh.c
+++ b/ssh.c
@@ -40,7 +40,7 @@
40 */ 40 */
41 41
42#include "includes.h" 42#include "includes.h"
43RCSID("$OpenBSD: ssh.c,v 1.245 2005/06/18 04:30:36 djm Exp $"); 43RCSID("$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,