summaryrefslogtreecommitdiff
path: root/readconf.c
diff options
context:
space:
mode:
Diffstat (limited to 'readconf.c')
-rw-r--r--readconf.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/readconf.c b/readconf.c
index 80d99fef1..399855bd4 100644
--- a/readconf.c
+++ b/readconf.c
@@ -81,6 +81,8 @@ RCSID("$OpenBSD: readconf.c,v 1.100 2002/06/19 00:27:55 deraadt Exp $");
81 RhostsRSAAuthentication yes 81 RhostsRSAAuthentication yes
82 StrictHostKeyChecking yes 82 StrictHostKeyChecking yes
83 KeepAlives no 83 KeepAlives no
84 ProtocolKeepAlives 0
85 SetupTimeOut 0
84 IdentityFile ~/.ssh/identity 86 IdentityFile ~/.ssh/identity
85 Port 22 87 Port 22
86 EscapeChar ~ 88 EscapeChar ~
@@ -114,6 +116,7 @@ typedef enum {
114 oDynamicForward, oPreferredAuthentications, oHostbasedAuthentication, 116 oDynamicForward, oPreferredAuthentications, oHostbasedAuthentication,
115 oHostKeyAlgorithms, oBindAddress, oSmartcardDevice, 117 oHostKeyAlgorithms, oBindAddress, oSmartcardDevice,
116 oClearAllForwardings, oNoHostAuthenticationForLocalhost, 118 oClearAllForwardings, oNoHostAuthenticationForLocalhost,
119 oProtocolKeepAlives, oSetupTimeOut,
117 oDeprecated 120 oDeprecated
118} OpCodes; 121} OpCodes;
119 122
@@ -186,6 +189,8 @@ static struct {
186 { "smartcarddevice", oSmartcardDevice }, 189 { "smartcarddevice", oSmartcardDevice },
187 { "clearallforwardings", oClearAllForwardings }, 190 { "clearallforwardings", oClearAllForwardings },
188 { "nohostauthenticationforlocalhost", oNoHostAuthenticationForLocalhost }, 191 { "nohostauthenticationforlocalhost", oNoHostAuthenticationForLocalhost },
192 { "protocolkeepalives", oProtocolKeepAlives },
193 { "setuptimeout", oSetupTimeOut },
189 { NULL, oBadOption } 194 { NULL, oBadOption }
190}; 195};
191 196
@@ -411,6 +416,14 @@ parse_flag:
411 intptr = &options->no_host_authentication_for_localhost; 416 intptr = &options->no_host_authentication_for_localhost;
412 goto parse_flag; 417 goto parse_flag;
413 418
419 case oProtocolKeepAlives:
420 intptr = &options->protocolkeepalives;
421 goto parse_int;
422
423 case oSetupTimeOut:
424 intptr = &options->setuptimeout;
425 goto parse_int;
426
414 case oNumberOfPasswordPrompts: 427 case oNumberOfPasswordPrompts:
415 intptr = &options->number_of_password_prompts; 428 intptr = &options->number_of_password_prompts;
416 goto parse_int; 429 goto parse_int;
@@ -766,6 +779,8 @@ initialize_options(Options * options)
766 options->strict_host_key_checking = -1; 779 options->strict_host_key_checking = -1;
767 options->compression = -1; 780 options->compression = -1;
768 options->keepalives = -1; 781 options->keepalives = -1;
782 options->protocolkeepalives = -1;
783 options->setuptimeout = -1;
769 options->compression_level = -1; 784 options->compression_level = -1;
770 options->port = -1; 785 options->port = -1;
771 options->connection_attempts = -1; 786 options->connection_attempts = -1;
@@ -853,6 +868,14 @@ fill_default_options(Options * options)
853 options->compression = 0; 868 options->compression = 0;
854 if (options->keepalives == -1) 869 if (options->keepalives == -1)
855 options->keepalives = 1; 870 options->keepalives = 1;
871 if (options->protocolkeepalives == -1){
872 if (options->batch_mode == 1) /*in batch mode, default is 5mins */
873 options->protocolkeepalives = 300;
874 else options->protocolkeepalives = 0;}
875 if (options->setuptimeout == -1){
876 if (options->batch_mode == 1) /*in batch mode, default is 5mins */
877 options->setuptimeout = 300;
878 else options->setuptimeout = 0;}
856 if (options->compression_level == -1) 879 if (options->compression_level == -1)
857 options->compression_level = 6; 880 options->compression_level = 6;
858 if (options->port == -1) 881 if (options->port == -1)