summaryrefslogtreecommitdiff
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
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@
-rw-r--r--ChangeLog6
-rw-r--r--readconf.c15
-rw-r--r--readconf.h3
-rw-r--r--ssh-keysign.c3
-rw-r--r--ssh.c17
5 files changed, 25 insertions, 19 deletions
diff --git a/ChangeLog b/ChangeLog
index 513b0f109..7ee25f842 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -30,6 +30,10 @@
30 - markus@cvs.openbsd.org 2003/07/03 08:24:13 30 - markus@cvs.openbsd.org 2003/07/03 08:24:13
31 [regress/Makefile] 31 [regress/Makefile]
32 enable tests for dynamic fwd via socks (-D), uses nc(1) 32 enable tests for dynamic fwd via socks (-D), uses nc(1)
33 - djm@cvs.openbsd.org 2003/07/03 08:09:06
34 [readconf.c readconf.h ssh-keysign.c ssh.c]
35 fix AddressFamily option in config file, from brent@graveland.net;
36 ok markus@
33 37
3420030630 3820030630
35 - (djm) Search for support functions necessary to build our 39 - (djm) Search for support functions necessary to build our
@@ -650,4 +654,4 @@
650 - Fix sshd BindAddress and -b options for systems using fake-getaddrinfo. 654 - Fix sshd BindAddress and -b options for systems using fake-getaddrinfo.
651 Report from murple@murple.net, diagnosis from dtucker@zip.com.au 655 Report from murple@murple.net, diagnosis from dtucker@zip.com.au
652 656
653$Id: ChangeLog,v 1.2843 2003/07/03 10:27:55 dtucker Exp $ 657$Id: ChangeLog,v 1.2844 2003/07/03 10:37:47 dtucker Exp $
diff --git a/readconf.c b/readconf.c
index a01d7a33e..3c08f7638 100644
--- a/readconf.c
+++ b/readconf.c
@@ -12,7 +12,7 @@
12 */ 12 */
13 13
14#include "includes.h" 14#include "includes.h"
15RCSID("$OpenBSD: readconf.c,v 1.113 2003/06/26 20:08:33 markus Exp $"); 15RCSID("$OpenBSD: readconf.c,v 1.114 2003/07/03 08:09:05 djm Exp $");
16 16
17#include "ssh.h" 17#include "ssh.h"
18#include "xmalloc.h" 18#include "xmalloc.h"
@@ -288,7 +288,6 @@ process_config_line(Options *options, const char *host,
288 size_t len; 288 size_t len;
289 u_short fwd_port, fwd_host_port; 289 u_short fwd_port, fwd_host_port;
290 char sfwd_host_port[6]; 290 char sfwd_host_port[6];
291 extern int IPv4or6;
292 291
293 /* Strip trailing whitespace */ 292 /* Strip trailing whitespace */
294 for(len = strlen(line) - 1; len > 0; len--) { 293 for(len = strlen(line) - 1; len > 0; len--) {
@@ -727,14 +726,17 @@ parse_int:
727 726
728 case oAddressFamily: 727 case oAddressFamily:
729 arg = strdelim(&s); 728 arg = strdelim(&s);
729 intptr = &options->address_family;
730 if (strcasecmp(arg, "inet") == 0) 730 if (strcasecmp(arg, "inet") == 0)
731 IPv4or6 = AF_INET; 731 value = AF_INET;
732 else if (strcasecmp(arg, "inet6") == 0) 732 else if (strcasecmp(arg, "inet6") == 0)
733 IPv4or6 = AF_INET6; 733 value = AF_INET6;
734 else if (strcasecmp(arg, "any") == 0) 734 else if (strcasecmp(arg, "any") == 0)
735 IPv4or6 = AF_UNSPEC; 735 value = AF_UNSPEC;
736 else 736 else
737 fatal("Unsupported AddressFamily \"%s\"", arg); 737 fatal("Unsupported AddressFamily \"%s\"", arg);
738 if (*activep && *intptr == -1)
739 *intptr = value;
738 break; 740 break;
739 741
740 case oEnableSSHKeysign: 742 case oEnableSSHKeysign:
@@ -839,6 +841,7 @@ initialize_options(Options * options)
839 options->keepalives = -1; 841 options->keepalives = -1;
840 options->compression_level = -1; 842 options->compression_level = -1;
841 options->port = -1; 843 options->port = -1;
844 options->address_family = -1;
842 options->connection_attempts = -1; 845 options->connection_attempts = -1;
843 options->connection_timeout = -1; 846 options->connection_timeout = -1;
844 options->number_of_password_prompts = -1; 847 options->number_of_password_prompts = -1;
@@ -926,6 +929,8 @@ fill_default_options(Options * options)
926 options->compression_level = 6; 929 options->compression_level = 6;
927 if (options->port == -1) 930 if (options->port == -1)
928 options->port = 0; /* Filled in ssh_connect. */ 931 options->port = 0; /* Filled in ssh_connect. */
932 if (options->address_family == -1)
933 options->address_family = AF_UNSPEC;
929 if (options->connection_attempts == -1) 934 if (options->connection_attempts == -1)
930 options->connection_attempts = 1; 935 options->connection_attempts = 1;
931 if (options->number_of_password_prompts == -1) 936 if (options->number_of_password_prompts == -1)
diff --git a/readconf.h b/readconf.h
index c884de68b..4e0b74318 100644
--- a/readconf.h
+++ b/readconf.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: readconf.h,v 1.50 2003/05/15 14:55:25 djm Exp $ */ 1/* $OpenBSD: readconf.h,v 1.51 2003/07/03 08:09:06 djm Exp $ */
2 2
3/* 3/*
4 * Author: Tatu Ylonen <ylo@cs.hut.fi> 4 * Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -58,6 +58,7 @@ typedef struct {
58 LogLevel log_level; /* Level for logging. */ 58 LogLevel log_level; /* Level for logging. */
59 59
60 int port; /* Port to connect. */ 60 int port; /* Port to connect. */
61 int address_family;
61 int connection_attempts; /* Max attempts (seconds) before 62 int connection_attempts; /* Max attempts (seconds) before
62 * giving up */ 63 * giving up */
63 int connection_timeout; /* Max time (seconds) before 64 int connection_timeout; /* Max time (seconds) before
diff --git a/ssh-keysign.c b/ssh-keysign.c
index 063364ee7..c7ca5c4e4 100644
--- a/ssh-keysign.c
+++ b/ssh-keysign.c
@@ -22,7 +22,7 @@
22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 */ 23 */
24#include "includes.h" 24#include "includes.h"
25RCSID("$OpenBSD: ssh-keysign.c,v 1.12 2003/05/16 03:27:12 djm Exp $"); 25RCSID("$OpenBSD: ssh-keysign.c,v 1.13 2003/07/03 08:09:06 djm Exp $");
26 26
27#include <openssl/evp.h> 27#include <openssl/evp.h>
28#include <openssl/rand.h> 28#include <openssl/rand.h>
@@ -44,7 +44,6 @@ RCSID("$OpenBSD: ssh-keysign.c,v 1.12 2003/05/16 03:27:12 djm Exp $");
44 44
45/* XXX readconf.c needs these */ 45/* XXX readconf.c needs these */
46uid_t original_real_uid; 46uid_t original_real_uid;
47int IPv4or6;
48 47
49#ifdef HAVE___PROGNAME 48#ifdef HAVE___PROGNAME
50extern char *__progname; 49extern char *__progname;
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