diff options
Diffstat (limited to 'readconf.c')
-rw-r--r-- | readconf.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/readconf.c b/readconf.c index 2591e0dba..3af3038bb 100644 --- a/readconf.c +++ b/readconf.c | |||
@@ -106,6 +106,7 @@ typedef enum { | |||
106 | oEnableSSHKeysign, oRekeyLimit, oVerifyHostKeyDNS, oConnectTimeout, | 106 | oEnableSSHKeysign, oRekeyLimit, oVerifyHostKeyDNS, oConnectTimeout, |
107 | oAddressFamily, oGssAuthentication, oGssDelegateCreds, | 107 | oAddressFamily, oGssAuthentication, oGssDelegateCreds, |
108 | oServerAliveInterval, oServerAliveCountMax, | 108 | oServerAliveInterval, oServerAliveCountMax, |
109 | oProtocolKeepAlives, oSetupTimeOut, | ||
109 | oDeprecated, oUnsupported | 110 | oDeprecated, oUnsupported |
110 | } OpCodes; | 111 | } OpCodes; |
111 | 112 | ||
@@ -192,6 +193,8 @@ static struct { | |||
192 | { "addressfamily", oAddressFamily }, | 193 | { "addressfamily", oAddressFamily }, |
193 | { "serveraliveinterval", oServerAliveInterval }, | 194 | { "serveraliveinterval", oServerAliveInterval }, |
194 | { "serveralivecountmax", oServerAliveCountMax }, | 195 | { "serveralivecountmax", oServerAliveCountMax }, |
196 | { "protocolkeepalives", oProtocolKeepAlives }, | ||
197 | { "setuptimeout", oSetupTimeOut }, | ||
195 | { NULL, oBadOption } | 198 | { NULL, oBadOption } |
196 | }; | 199 | }; |
197 | 200 | ||
@@ -737,6 +740,7 @@ parse_int: | |||
737 | goto parse_flag; | 740 | goto parse_flag; |
738 | 741 | ||
739 | case oServerAliveInterval: | 742 | case oServerAliveInterval: |
743 | case oProtocolKeepAlives: /* Debian-specific compatibility alias */ | ||
740 | intptr = &options->server_alive_interval; | 744 | intptr = &options->server_alive_interval; |
741 | goto parse_time; | 745 | goto parse_time; |
742 | 746 | ||
@@ -744,6 +748,10 @@ parse_int: | |||
744 | intptr = &options->server_alive_count_max; | 748 | intptr = &options->server_alive_count_max; |
745 | goto parse_int; | 749 | goto parse_int; |
746 | 750 | ||
751 | case oSetupTimeOut: | ||
752 | intptr = &options->setuptimeout; | ||
753 | goto parse_int; | ||
754 | |||
747 | case oDeprecated: | 755 | case oDeprecated: |
748 | debug("%s line %d: Deprecated option \"%s\"", | 756 | debug("%s line %d: Deprecated option \"%s\"", |
749 | filename, linenum, keyword); | 757 | filename, linenum, keyword); |
@@ -839,6 +847,7 @@ initialize_options(Options * options) | |||
839 | options->strict_host_key_checking = -1; | 847 | options->strict_host_key_checking = -1; |
840 | options->compression = -1; | 848 | options->compression = -1; |
841 | options->tcp_keep_alive = -1; | 849 | options->tcp_keep_alive = -1; |
850 | options->setuptimeout = -1; | ||
842 | options->compression_level = -1; | 851 | options->compression_level = -1; |
843 | options->port = -1; | 852 | options->port = -1; |
844 | options->address_family = -1; | 853 | options->address_family = -1; |
@@ -987,10 +996,22 @@ fill_default_options(Options * options) | |||
987 | options->rekey_limit = 0; | 996 | options->rekey_limit = 0; |
988 | if (options->verify_host_key_dns == -1) | 997 | if (options->verify_host_key_dns == -1) |
989 | options->verify_host_key_dns = 0; | 998 | options->verify_host_key_dns = 0; |
990 | if (options->server_alive_interval == -1) | 999 | if (options->server_alive_interval == -1) { |
991 | options->server_alive_interval = 0; | 1000 | /* in batch mode, default is 5mins */ |
1001 | if (options->batch_mode == 1) | ||
1002 | options->server_alive_interval = 300; | ||
1003 | else | ||
1004 | options->server_alive_interval = 0; | ||
1005 | } | ||
992 | if (options->server_alive_count_max == -1) | 1006 | if (options->server_alive_count_max == -1) |
993 | options->server_alive_count_max = 3; | 1007 | options->server_alive_count_max = 3; |
1008 | if (options->setuptimeout == -1) { | ||
1009 | /* in batch mode, default is 5mins */ | ||
1010 | if (options->batch_mode == 1) | ||
1011 | options->setuptimeout = 300; | ||
1012 | else | ||
1013 | options->setuptimeout = 0; | ||
1014 | } | ||
994 | /* options->proxy_command should not be set by default */ | 1015 | /* options->proxy_command should not be set by default */ |
995 | /* options->user will be set in the main program if appropriate */ | 1016 | /* options->user will be set in the main program if appropriate */ |
996 | /* options->hostname will be set in the main program if appropriate */ | 1017 | /* options->hostname will be set in the main program if appropriate */ |