summaryrefslogtreecommitdiff
path: root/usr.bin/ssh/readconf.c
diff options
context:
space:
mode:
authorDamien Miller <djm@cvs.openbsd.org>2003-05-16 03:27:13 +0000
committerDamien Miller <djm@cvs.openbsd.org>2003-05-16 03:27:13 +0000
commitea5e1e7b5a616ddf2e7aa04bec77b9a1142f72a4 (patch)
tree9be91c00de78445cbd34fe6a0012f8ce3dc28920 /usr.bin/ssh/readconf.c
parent196cb361691e6b713df554208e03d0c32bcd4634 (diff)
add AddressFamily option to ssh_config (like -4, -6 on commandline).
Portable bug #534; ok markus@
Diffstat (limited to 'usr.bin/ssh/readconf.c')
-rw-r--r--usr.bin/ssh/readconf.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/usr.bin/ssh/readconf.c b/usr.bin/ssh/readconf.c
index df769736403..7af9af25fae 100644
--- a/usr.bin/ssh/readconf.c
+++ b/usr.bin/ssh/readconf.c
@@ -12,7 +12,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: readconf.c,v 1.111 2003/05/15 14:55:25 djm Exp $");
+RCSID("$OpenBSD: readconf.c,v 1.112 2003/05/16 03:27:12 djm Exp $");
#include "ssh.h"
#include "xmalloc.h"
@@ -107,6 +107,7 @@ typedef enum {
oHostKeyAlgorithms, oBindAddress, oSmartcardDevice,
oClearAllForwardings, oNoHostAuthenticationForLocalhost,
oEnableSSHKeysign, oRekeyLimit, oVerifyHostKeyDNS, oConnectTimeout,
+ oAddressFamily,
oDeprecated, oUnsupported
} OpCodes;
@@ -194,6 +195,7 @@ static struct {
{ "nohostauthenticationforlocalhost", oNoHostAuthenticationForLocalhost },
{ "rekeylimit", oRekeyLimit },
{ "connecttimeout", oConnectTimeout },
+ { "addressfamily", oAddressFamily },
{ NULL, oBadOption }
};
@@ -284,6 +286,7 @@ process_config_line(Options *options, const char *host,
size_t len;
u_short fwd_port, fwd_host_port;
char sfwd_host_port[6];
+ extern int IPv4or6;
/* Strip trailing whitespace */
for(len = strlen(line) - 1; len > 0; len--) {
@@ -718,6 +721,18 @@ parse_int:
*intptr = value;
break;
+ case oAddressFamily:
+ arg = strdelim(&s);
+ if (strcasecmp(arg, "inet") == 0)
+ IPv4or6 = AF_INET;
+ else if (strcasecmp(arg, "inet6") == 0)
+ IPv4or6 = AF_INET6;
+ else if (strcasecmp(arg, "any") == 0)
+ IPv4or6 = AF_UNSPEC;
+ else
+ fatal("Unsupported AddressFamily \"%s\"", arg);
+ break;
+
case oEnableSSHKeysign:
intptr = &options->enable_ssh_keysign;
goto parse_flag;