[readconf.c readconf.h ssh-keysign.c ssh.c]
fix AddressFamily option in config file, from brent@graveland.net;
ok markus@
- markus@cvs.openbsd.org 2003/07/03 08:24:13
[regress/Makefile]
enable tests for dynamic fwd via socks (-D), uses nc(1)
- markus@cvs.openbsd.org 2003/07/03 08:24:13
[regress/Makefile]
enable tests for dynamic fwd via socks (-D), uses nc(1)
+ - 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@
20030630
- (djm) Search for support functions necessary to build our
20030630
- (djm) Search for support functions necessary to build our
-RCSID("$OpenBSD: readconf.c,v 1.113 2003/06/26 20:08:33 markus Exp $");
+RCSID("$OpenBSD: readconf.c,v 1.114 2003/07/03 08:09:05 djm Exp $");
#include "ssh.h"
#include "xmalloc.h"
#include "ssh.h"
#include "xmalloc.h"
size_t len;
u_short fwd_port, fwd_host_port;
char sfwd_host_port[6];
size_t len;
u_short fwd_port, fwd_host_port;
char sfwd_host_port[6];
/* Strip trailing whitespace */
for(len = strlen(line) - 1; len > 0; len--) {
/* Strip trailing whitespace */
for(len = strlen(line) - 1; len > 0; len--) {
case oAddressFamily:
arg = strdelim(&s);
case oAddressFamily:
arg = strdelim(&s);
+ intptr = &options->address_family;
if (strcasecmp(arg, "inet") == 0)
if (strcasecmp(arg, "inet") == 0)
else if (strcasecmp(arg, "inet6") == 0)
else if (strcasecmp(arg, "inet6") == 0)
else if (strcasecmp(arg, "any") == 0)
else if (strcasecmp(arg, "any") == 0)
else
fatal("Unsupported AddressFamily \"%s\"", arg);
else
fatal("Unsupported AddressFamily \"%s\"", arg);
+ if (*activep && *intptr == -1)
+ *intptr = value;
break;
case oEnableSSHKeysign:
break;
case oEnableSSHKeysign:
options->keepalives = -1;
options->compression_level = -1;
options->port = -1;
options->keepalives = -1;
options->compression_level = -1;
options->port = -1;
+ options->address_family = -1;
options->connection_attempts = -1;
options->connection_timeout = -1;
options->number_of_password_prompts = -1;
options->connection_attempts = -1;
options->connection_timeout = -1;
options->number_of_password_prompts = -1;
options->compression_level = 6;
if (options->port == -1)
options->port = 0; /* Filled in ssh_connect. */
options->compression_level = 6;
if (options->port == -1)
options->port = 0; /* Filled in ssh_connect. */
+ if (options->address_family == -1)
+ options->address_family = AF_UNSPEC;
if (options->connection_attempts == -1)
options->connection_attempts = 1;
if (options->number_of_password_prompts == -1)
if (options->connection_attempts == -1)
options->connection_attempts = 1;
if (options->number_of_password_prompts == -1)
-/* $OpenBSD: readconf.h,v 1.50 2003/05/15 14:55:25 djm Exp $ */
+/* $OpenBSD: readconf.h,v 1.51 2003/07/03 08:09:06 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
LogLevel log_level; /* Level for logging. */
int port; /* Port to connect. */
LogLevel log_level; /* Level for logging. */
int port; /* Port to connect. */
int connection_attempts; /* Max attempts (seconds) before
* giving up */
int connection_timeout; /* Max time (seconds) before
int connection_attempts; /* Max attempts (seconds) before
* giving up */
int connection_timeout; /* Max time (seconds) before
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "includes.h"
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "includes.h"
-RCSID("$OpenBSD: ssh-keysign.c,v 1.12 2003/05/16 03:27:12 djm Exp $");
+RCSID("$OpenBSD: ssh-keysign.c,v 1.13 2003/07/03 08:09:06 djm Exp $");
#include <openssl/evp.h>
#include <openssl/rand.h>
#include <openssl/evp.h>
#include <openssl/rand.h>
/* XXX readconf.c needs these */
uid_t original_real_uid;
/* XXX readconf.c needs these */
uid_t original_real_uid;
#ifdef HAVE___PROGNAME
extern char *__progname;
#ifdef HAVE___PROGNAME
extern char *__progname;
-RCSID("$OpenBSD: ssh.c,v 1.195 2003/07/02 20:37:48 markus Exp $");
+RCSID("$OpenBSD: ssh.c,v 1.196 2003/07/03 08:09:06 djm Exp $");
#include <openssl/evp.h>
#include <openssl/err.h>
#include <openssl/evp.h>
#include <openssl/err.h>
-/* Flag indicating whether IPv4 or IPv6. This can be set on the command line.
- Default value is AF_UNSPEC means both IPv4 and IPv6. */
-int IPv4or6 = AF_UNSPEC;
-
/* Flag indicating whether debug mode is on. This can be set on the command line. */
int debug_flag = 0;
/* Flag indicating whether debug mode is on. This can be set on the command line. */
int debug_flag = 0;
options.protocol = SSH_PROTO_2;
break;
case '4':
options.protocol = SSH_PROTO_2;
break;
case '4':
+ options.address_family = AF_INET;
+ options.address_family = AF_INET6;
break;
case 'n':
stdin_null_flag = 1;
break;
case 'n':
stdin_null_flag = 1;
SSLeay_add_all_algorithms();
ERR_load_crypto_strings();
SSLeay_add_all_algorithms();
ERR_load_crypto_strings();
- channel_set_af(IPv4or6);
/* Initialize the command to execute on remote host. */
buffer_init(&command);
/* Initialize the command to execute on remote host. */
buffer_init(&command);
/* Fill configuration defaults. */
fill_default_options(&options);
/* Fill configuration defaults. */
fill_default_options(&options);
+ channel_set_af(options.address_family);
+
/* reinit */
log_init(av[0], options.log_level, SYSLOG_FACILITY_USER, 1);
/* reinit */
log_init(av[0], options.log_level, SYSLOG_FACILITY_USER, 1);
}
/* Open a connection to the remote host. */
}
/* Open a connection to the remote host. */
- if (ssh_connect(host, &hostaddr, options.port, IPv4or6,
- options.connection_attempts,
+ if (ssh_connect(host, &hostaddr, options.port,
+ options.address_family, options.connection_attempts,
#ifdef HAVE_CYGWIN
options.use_privileged_port,
#else
#ifdef HAVE_CYGWIN
options.use_privileged_port,
#else