summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/ssh.c
diff options
context:
space:
mode:
authordjm <djm@openbsd.org>2005-06-25 22:47:49 +0000
committerdjm <djm@openbsd.org>2005-06-25 22:47:49 +0000
commit4685da342b13bed0f3be6a09d5de1fad0272151d (patch)
tree54a574256afc4da62fa2d0e204724065042eb861 /usr.bin/ssh/ssh.c
parentthe local macro _id was removed before this code was even imported from NetBSD (diff)
downloadwireguard-openbsd-4685da342b13bed0f3be6a09d5de1fad0272151d.tar.xz
wireguard-openbsd-4685da342b13bed0f3be6a09d5de1fad0272151d.zip
do the default port filling code a few lines earlier, so it really does fix %p
Diffstat (limited to 'usr.bin/ssh/ssh.c')
-rw-r--r--usr.bin/ssh/ssh.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/usr.bin/ssh/ssh.c b/usr.bin/ssh/ssh.c
index 3e4741c6aab..b4ea992fb2a 100644
--- a/usr.bin/ssh/ssh.c
+++ b/usr.bin/ssh/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>
@@ -600,6 +600,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;
@@ -620,12 +626,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,