summaryrefslogtreecommitdiff
path: root/ssh.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2003-07-03 20:37:47 +1000
committerDarren Tucker <dtucker@zip.com.au>2003-07-03 20:37:47 +1000
commit0a4f04b5b255d116e4de441c93a867aac9f616ee (patch)
tree1657ea69bfe6feb794b62469a30370c48135fa33 /ssh.c
parente2f2be7a3abd4176baded47da1d1d02de3ed1984 (diff)
- djm@cvs.openbsd.org 2003/07/03 08:09:06
[readconf.c readconf.h ssh-keysign.c ssh.c] fix AddressFamily option in config file, from brent@graveland.net; ok markus@
Diffstat (limited to 'ssh.c')
-rw-r--r--ssh.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/ssh.c b/ssh.c
index a86f9204f..1f1f06834 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.195 2003/07/02 20:37:48 markus Exp $"); 43RCSID("$OpenBSD: ssh.c,v 1.196 2003/07/03 08:09:06 djm Exp $");
44 44
45#include <openssl/evp.h> 45#include <openssl/evp.h>
46#include <openssl/err.h> 46#include <openssl/err.h>
@@ -79,10 +79,6 @@ extern char *__progname;
79char *__progname; 79char *__progname;
80#endif 80#endif
81 81
82/* Flag indicating whether IPv4 or IPv6. This can be set on the command line.
83 Default value is AF_UNSPEC means both IPv4 and IPv6. */
84int IPv4or6 = AF_UNSPEC;
85
86/* Flag indicating whether debug mode is on. This can be set on the command line. */ 82/* Flag indicating whether debug mode is on. This can be set on the command line. */
87int debug_flag = 0; 83int debug_flag = 0;
88 84
@@ -280,10 +276,10 @@ again:
280 options.protocol = SSH_PROTO_2; 276 options.protocol = SSH_PROTO_2;
281 break; 277 break;
282 case '4': 278 case '4':
283 IPv4or6 = AF_INET; 279 options.address_family = AF_INET;
284 break; 280 break;
285 case '6': 281 case '6':
286 IPv4or6 = AF_INET6; 282 options.address_family = AF_INET6;
287 break; 283 break;
288 case 'n': 284 case 'n':
289 stdin_null_flag = 1; 285 stdin_null_flag = 1;
@@ -514,7 +510,6 @@ again:
514 510
515 SSLeay_add_all_algorithms(); 511 SSLeay_add_all_algorithms();
516 ERR_load_crypto_strings(); 512 ERR_load_crypto_strings();
517 channel_set_af(IPv4or6);
518 513
519 /* Initialize the command to execute on remote host. */ 514 /* Initialize the command to execute on remote host. */
520 buffer_init(&command); 515 buffer_init(&command);
@@ -586,6 +581,8 @@ again:
586 /* Fill configuration defaults. */ 581 /* Fill configuration defaults. */
587 fill_default_options(&options); 582 fill_default_options(&options);
588 583
584 channel_set_af(options.address_family);
585
589 /* reinit */ 586 /* reinit */
590 log_init(av[0], options.log_level, SYSLOG_FACILITY_USER, 1); 587 log_init(av[0], options.log_level, SYSLOG_FACILITY_USER, 1);
591 588
@@ -621,8 +618,8 @@ again:
621 } 618 }
622 /* Open a connection to the remote host. */ 619 /* Open a connection to the remote host. */
623 620
624 if (ssh_connect(host, &hostaddr, options.port, IPv4or6, 621 if (ssh_connect(host, &hostaddr, options.port,
625 options.connection_attempts, 622 options.address_family, options.connection_attempts,
626#ifdef HAVE_CYGWIN 623#ifdef HAVE_CYGWIN
627 options.use_privileged_port, 624 options.use_privileged_port,
628#else 625#else