- djm@cvs.openbsd.org 2003/05/16 03:27:12
     [readconf.c ssh_config ssh_config.5 ssh-keysign.c]
     add AddressFamily option to ssh_config (like -4, -6 on commandline).
     Portable bug #534; ok markus@
diff --git a/readconf.c b/readconf.c
index a0cf3d6..2a77ea1 100644
--- a/readconf.c
+++ b/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 @@
 	oHostKeyAlgorithms, oBindAddress, oSmartcardDevice,
 	oClearAllForwardings, oNoHostAuthenticationForLocalhost,
 	oEnableSSHKeysign, oRekeyLimit, oVerifyHostKeyDNS, oConnectTimeout,
+	oAddressFamily,
 	oDeprecated, oUnsupported
 } OpCodes;
 
@@ -194,6 +195,7 @@
 	{ "nohostauthenticationforlocalhost", oNoHostAuthenticationForLocalhost },
 	{ "rekeylimit", oRekeyLimit },
 	{ "connecttimeout", oConnectTimeout },
+	{ "addressfamily", oAddressFamily },
 	{ NULL, oBadOption }
 };
 
@@ -286,6 +288,7 @@
 	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--) {
@@ -720,6 +723,18 @@
 			*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;