summaryrefslogtreecommitdiff
path: root/readconf.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2003-12-17 16:33:10 +1100
committerDamien Miller <djm@mindrot.org>2003-12-17 16:33:10 +1100
commit509b0107f0e67cb4af663c147179d35fa6425614 (patch)
treeb4662caa51b3ac22533e03221a7fdc886ed27619 /readconf.c
parentbaafb981a46d79e576b340dab436c17415f0033a (diff)
- markus@cvs.openbsd.org 2003/12/16 15:49:51
[clientloop.c clientloop.h readconf.c readconf.h scp.1 sftp.1 ssh.1] [ssh.c ssh_config.5] application layer keep alive (ServerAliveInterval ServerAliveCountMax) for ssh(1), similar to the sshd(8) option; ok beck@; with help from jmc and dtucker@
Diffstat (limited to 'readconf.c')
-rw-r--r--readconf.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/readconf.c b/readconf.c
index cd2c81443..2591e0dba 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.126 2003/12/09 21:53:36 markus Exp $"); 15RCSID("$OpenBSD: readconf.c,v 1.127 2003/12/16 15:49:51 markus Exp $");
16 16
17#include "ssh.h" 17#include "ssh.h"
18#include "xmalloc.h" 18#include "xmalloc.h"
@@ -105,6 +105,7 @@ typedef enum {
105 oClearAllForwardings, oNoHostAuthenticationForLocalhost, 105 oClearAllForwardings, oNoHostAuthenticationForLocalhost,
106 oEnableSSHKeysign, oRekeyLimit, oVerifyHostKeyDNS, oConnectTimeout, 106 oEnableSSHKeysign, oRekeyLimit, oVerifyHostKeyDNS, oConnectTimeout,
107 oAddressFamily, oGssAuthentication, oGssDelegateCreds, 107 oAddressFamily, oGssAuthentication, oGssDelegateCreds,
108 oServerAliveInterval, oServerAliveCountMax,
108 oDeprecated, oUnsupported 109 oDeprecated, oUnsupported
109} OpCodes; 110} OpCodes;
110 111
@@ -189,6 +190,8 @@ static struct {
189 { "rekeylimit", oRekeyLimit }, 190 { "rekeylimit", oRekeyLimit },
190 { "connecttimeout", oConnectTimeout }, 191 { "connecttimeout", oConnectTimeout },
191 { "addressfamily", oAddressFamily }, 192 { "addressfamily", oAddressFamily },
193 { "serveraliveinterval", oServerAliveInterval },
194 { "serveralivecountmax", oServerAliveCountMax },
192 { NULL, oBadOption } 195 { NULL, oBadOption }
193}; 196};
194 197
@@ -307,7 +310,7 @@ process_config_line(Options *options, const char *host,
307 /* NOTREACHED */ 310 /* NOTREACHED */
308 case oConnectTimeout: 311 case oConnectTimeout:
309 intptr = &options->connection_timeout; 312 intptr = &options->connection_timeout;
310/* parse_time: */ 313parse_time:
311 arg = strdelim(&s); 314 arg = strdelim(&s);
312 if (!arg || *arg == '\0') 315 if (!arg || *arg == '\0')
313 fatal("%s line %d: missing time value.", 316 fatal("%s line %d: missing time value.",
@@ -733,6 +736,14 @@ parse_int:
733 intptr = &options->enable_ssh_keysign; 736 intptr = &options->enable_ssh_keysign;
734 goto parse_flag; 737 goto parse_flag;
735 738
739 case oServerAliveInterval:
740 intptr = &options->server_alive_interval;
741 goto parse_time;
742
743 case oServerAliveCountMax:
744 intptr = &options->server_alive_count_max;
745 goto parse_int;
746
736 case oDeprecated: 747 case oDeprecated:
737 debug("%s line %d: Deprecated option \"%s\"", 748 debug("%s line %d: Deprecated option \"%s\"",
738 filename, linenum, keyword); 749 filename, linenum, keyword);
@@ -860,6 +871,8 @@ initialize_options(Options * options)
860 options->no_host_authentication_for_localhost = - 1; 871 options->no_host_authentication_for_localhost = - 1;
861 options->rekey_limit = - 1; 872 options->rekey_limit = - 1;
862 options->verify_host_key_dns = -1; 873 options->verify_host_key_dns = -1;
874 options->server_alive_interval = -1;
875 options->server_alive_count_max = -1;
863} 876}
864 877
865/* 878/*
@@ -974,6 +987,10 @@ fill_default_options(Options * options)
974 options->rekey_limit = 0; 987 options->rekey_limit = 0;
975 if (options->verify_host_key_dns == -1) 988 if (options->verify_host_key_dns == -1)
976 options->verify_host_key_dns = 0; 989 options->verify_host_key_dns = 0;
990 if (options->server_alive_interval == -1)
991 options->server_alive_interval = 0;
992 if (options->server_alive_count_max == -1)
993 options->server_alive_count_max = 3;
977 /* options->proxy_command should not be set by default */ 994 /* options->proxy_command should not be set by default */
978 /* options->user will be set in the main program if appropriate */ 995 /* options->user will be set in the main program if appropriate */
979 /* options->hostname will be set in the main program if appropriate */ 996 /* options->hostname will be set in the main program if appropriate */