summaryrefslogtreecommitdiff
path: root/readconf.c
diff options
context:
space:
mode:
Diffstat (limited to 'readconf.c')
-rw-r--r--readconf.c27
1 files changed, 24 insertions, 3 deletions
diff --git a/readconf.c b/readconf.c
index ce0d1f753..2b8ff58d6 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, oIdentitiesOnly, 108 oServerAliveInterval, oServerAliveCountMax, oIdentitiesOnly,
109 oProtocolKeepAlives, oSetupTimeOut,
109 oDeprecated, oUnsupported 110 oDeprecated, oUnsupported
110} OpCodes; 111} OpCodes;
111 112
@@ -193,6 +194,8 @@ static struct {
193 { "addressfamily", oAddressFamily }, 194 { "addressfamily", oAddressFamily },
194 { "serveraliveinterval", oServerAliveInterval }, 195 { "serveraliveinterval", oServerAliveInterval },
195 { "serveralivecountmax", oServerAliveCountMax }, 196 { "serveralivecountmax", oServerAliveCountMax },
197 { "protocolkeepalives", oProtocolKeepAlives },
198 { "setuptimeout", oSetupTimeOut },
196 { NULL, oBadOption } 199 { NULL, oBadOption }
197}; 200};
198 201
@@ -742,6 +745,7 @@ parse_int:
742 goto parse_flag; 745 goto parse_flag;
743 746
744 case oServerAliveInterval: 747 case oServerAliveInterval:
748 case oProtocolKeepAlives: /* Debian-specific compatibility alias */
745 intptr = &options->server_alive_interval; 749 intptr = &options->server_alive_interval;
746 goto parse_time; 750 goto parse_time;
747 751
@@ -749,6 +753,10 @@ parse_int:
749 intptr = &options->server_alive_count_max; 753 intptr = &options->server_alive_count_max;
750 goto parse_int; 754 goto parse_int;
751 755
756 case oSetupTimeOut:
757 intptr = &options->setuptimeout;
758 goto parse_int;
759
752 case oDeprecated: 760 case oDeprecated:
753 debug("%s line %d: Deprecated option \"%s\"", 761 debug("%s line %d: Deprecated option \"%s\"",
754 filename, linenum, keyword); 762 filename, linenum, keyword);
@@ -844,6 +852,7 @@ initialize_options(Options * options)
844 options->strict_host_key_checking = -1; 852 options->strict_host_key_checking = -1;
845 options->compression = -1; 853 options->compression = -1;
846 options->tcp_keep_alive = -1; 854 options->tcp_keep_alive = -1;
855 options->setuptimeout = -1;
847 options->compression_level = -1; 856 options->compression_level = -1;
848 options->port = -1; 857 options->port = -1;
849 options->address_family = -1; 858 options->address_family = -1;
@@ -896,7 +905,7 @@ fill_default_options(Options * options)
896 if (options->forward_x11 == -1) 905 if (options->forward_x11 == -1)
897 options->forward_x11 = 0; 906 options->forward_x11 = 0;
898 if (options->forward_x11_trusted == -1) 907 if (options->forward_x11_trusted == -1)
899 options->forward_x11_trusted = 0; 908 options->forward_x11_trusted = 1;
900 if (options->xauth_location == NULL) 909 if (options->xauth_location == NULL)
901 options->xauth_location = _PATH_XAUTH; 910 options->xauth_location = _PATH_XAUTH;
902 if (options->gateway_ports == -1) 911 if (options->gateway_ports == -1)
@@ -995,10 +1004,22 @@ fill_default_options(Options * options)
995 options->rekey_limit = 0; 1004 options->rekey_limit = 0;
996 if (options->verify_host_key_dns == -1) 1005 if (options->verify_host_key_dns == -1)
997 options->verify_host_key_dns = 0; 1006 options->verify_host_key_dns = 0;
998 if (options->server_alive_interval == -1) 1007 if (options->server_alive_interval == -1) {
999 options->server_alive_interval = 0; 1008 /* in batch mode, default is 5mins */
1009 if (options->batch_mode == 1)
1010 options->server_alive_interval = 300;
1011 else
1012 options->server_alive_interval = 0;
1013 }
1000 if (options->server_alive_count_max == -1) 1014 if (options->server_alive_count_max == -1)
1001 options->server_alive_count_max = 3; 1015 options->server_alive_count_max = 3;
1016 if (options->setuptimeout == -1) {
1017 /* in batch mode, default is 5mins */
1018 if (options->batch_mode == 1)
1019 options->setuptimeout = 300;
1020 else
1021 options->setuptimeout = 0;
1022 }
1002 /* options->proxy_command should not be set by default */ 1023 /* options->proxy_command should not be set by default */
1003 /* options->user will be set in the main program if appropriate */ 1024 /* options->user will be set in the main program if appropriate */
1004 /* options->hostname will be set in the main program if appropriate */ 1025 /* options->hostname will be set in the main program if appropriate */