summaryrefslogtreecommitdiff
path: root/usr.bin/ssh/sshd.c
diff options
context:
space:
mode:
authorDamien Miller <djm@cvs.openbsd.org>2004-12-23 23:11:01 +0000
committerDamien Miller <djm@cvs.openbsd.org>2004-12-23 23:11:01 +0000
commit2a4de8d57e47227dcf7632452c4628b4cc643ef4 (patch)
tree4334e0afaad5146060f3c1d70ab0aec6c745e14f /usr.bin/ssh/sshd.c
parent34273868d59e739c2529893b2d252f1f4a319179 (diff)
bz #898: support AddressFamily in sshd_config. from peak@argo.troja.mff.cuni.cz
ok deraadt@
Diffstat (limited to 'usr.bin/ssh/sshd.c')
-rw-r--r--usr.bin/ssh/sshd.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/usr.bin/ssh/sshd.c b/usr.bin/ssh/sshd.c
index ce7d85f9fd6..21b676831a7 100644
--- a/usr.bin/ssh/sshd.c
+++ b/usr.bin/ssh/sshd.c
@@ -42,7 +42,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: sshd.c,v 1.304 2004/09/25 03:45:14 djm Exp $");
+RCSID("$OpenBSD: sshd.c,v 1.305 2004/12/23 23:11:00 djm Exp $");
#include <openssl/dh.h>
#include <openssl/bn.h>
@@ -108,12 +108,6 @@ ServerOptions options;
char *config_file_name = _PATH_SERVER_CONFIG_FILE;
/*
- * 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;
-
-/*
* Debug mode flag. This can be set on the command line. If debug
* mode is enabled, extra debugging output will be sent to the system
* log, the daemon will not go to background, and will exit after processing
@@ -891,10 +885,10 @@ main(int ac, char **av)
while ((opt = getopt(ac, av, "f:p:b:k:h:g:u:o:dDeiqrtQR46")) != -1) {
switch (opt) {
case '4':
- IPv4or6 = AF_INET;
+ options.address_family = AF_INET;
break;
case '6':
- IPv4or6 = AF_INET6;
+ options.address_family = AF_INET6;
break;
case 'f':
config_file_name = optarg;
@@ -995,7 +989,6 @@ main(int ac, char **av)
closefrom(REEXEC_DEVCRYPTO_RESERVED_FD);
SSLeay_add_all_algorithms();
- channel_set_af(IPv4or6);
/*
* Force logging to stderr until we have loaded the private host
@@ -1029,6 +1022,9 @@ main(int ac, char **av)
/* Fill in default values for those options not explicitly set. */
fill_default_server_options(&options);
+ /* set default channel AF */
+ channel_set_af(options.address_family);
+
/* Check that there are no remaining arguments. */
if (optind < ac) {
fprintf(stderr, "Extra argument %s.\n", av[optind]);