summaryrefslogtreecommitdiffstats
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
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
-rw-r--r--ChangeLog5
-rw-r--r--ssh.c14
2 files changed, 11 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 519168aa..cdeb942f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,9 @@
- djm@cvs.openbsd.org 2005/06/18 04:30:36
[ssh.c ssh_config.5]
allow ControlPath=none, patch from dwmw2 AT infradead.org; ok dtucker@
+ - 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
20050618
- (djm) OpenBSD CVS Sync
@@ -2759,4 +2762,4 @@
- (djm) Trim deprecated options from INSTALL. Mention UsePAM
- (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu
-$Id: ChangeLog,v 1.3829 2005/06/25 22:56:03 djm Exp $
+$Id: ChangeLog,v 1.3830 2005/06/25 22:56:31 djm Exp $
diff --git a/ssh.c b/ssh.c
index 91f8559d..67af53e6 100644
--- a/ssh.c
+++ b/ssh.c
@@ -40,7 +40,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: ssh.c,v 1.245 2005/06/18 04:30:36 djm Exp $");
+RCSID("$OpenBSD: ssh.c,v 1.246 2005/06/25 22:47:49 djm Exp $");
#include <openssl/evp.h>
#include <openssl/err.h>
@@ -607,6 +607,12 @@ again:
*p = tolower(*p);
}
+ /* Get default port if port has not been set. */
+ if (options.port == 0) {
+ sp = getservbyname(SSH_SERVICE_NAME, "tcp");
+ options.port = sp ? ntohs(sp->s_port) : SSH_DEFAULT_PORT;
+ }
+
if (options.proxy_command != NULL &&
strcmp(options.proxy_command, "none") == 0)
options.proxy_command = NULL;
@@ -627,12 +633,6 @@ again:
if (options.control_path != NULL)
control_client(options.control_path);
- /* Get default port if port has not been set. */
- if (options.port == 0) {
- sp = getservbyname(SSH_SERVICE_NAME, "tcp");
- options.port = sp ? ntohs(sp->s_port) : SSH_DEFAULT_PORT;
- }
-
/* Open a connection to the remote host. */
if (ssh_connect(host, &hostaddr, options.port,
options.address_family, options.connection_attempts,