- 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
This commit is contained in:
Damien Miller 2005-06-26 08:56:31 +10:00
parent 8f74c8fc32
commit 7c71cc738c
2 changed files with 11 additions and 8 deletions

View File

@ -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 $

14
ssh.c
View File

@ -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,