summaryrefslogtreecommitdiff
path: root/readconf.c
diff options
context:
space:
mode:
authorRichard Kettlewell <rjk@greenend.org.uk>2014-02-09 16:09:52 +0000
committerColin Watson <cjwatson@debian.org>2017-10-04 13:54:48 +0100
commitc147d4dbab74e0dbf738beb9d9f4220534ae9da6 (patch)
tree3a1dabf64acc0d3480d54e9241fbd8c8e01b78c7 /readconf.c
parent19971fb92159a621b55f0b9da76dd38a56d7247c (diff)
Various keepalive extensions
Add compatibility aliases for ProtocolKeepAlives and SetupTimeOut, supported in previous versions of Debian's OpenSSH package but since superseded by ServerAliveInterval. (We're probably stuck with this bit for compatibility.) In batch mode, default ServerAliveInterval to five minutes. Adjust documentation to match and to give some more advice on use of keepalives. Author: Ian Jackson <ian@chiark.greenend.org.uk> Author: Matthew Vernon <matthew@debian.org> Author: Colin Watson <cjwatson@debian.org> Last-Update: 2017-10-04 Patch-Name: keepalive-extensions.patch
Diffstat (limited to 'readconf.c')
-rw-r--r--readconf.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/readconf.c b/readconf.c
index d2b28a41b..45caa0951 100644
--- a/readconf.c
+++ b/readconf.c
@@ -174,6 +174,7 @@ typedef enum {
174 oStreamLocalBindMask, oStreamLocalBindUnlink, oRevokedHostKeys, 174 oStreamLocalBindMask, oStreamLocalBindUnlink, oRevokedHostKeys,
175 oFingerprintHash, oUpdateHostkeys, oHostbasedKeyTypes, 175 oFingerprintHash, oUpdateHostkeys, oHostbasedKeyTypes,
176 oPubkeyAcceptedKeyTypes, oProxyJump, 176 oPubkeyAcceptedKeyTypes, oProxyJump,
177 oProtocolKeepAlives, oSetupTimeOut,
177 oIgnore, oIgnoredUnknownOption, oDeprecated, oUnsupported 178 oIgnore, oIgnoredUnknownOption, oDeprecated, oUnsupported
178} OpCodes; 179} OpCodes;
179 180
@@ -318,6 +319,8 @@ static struct {
318 { "pubkeyacceptedkeytypes", oPubkeyAcceptedKeyTypes }, 319 { "pubkeyacceptedkeytypes", oPubkeyAcceptedKeyTypes },
319 { "ignoreunknown", oIgnoreUnknown }, 320 { "ignoreunknown", oIgnoreUnknown },
320 { "proxyjump", oProxyJump }, 321 { "proxyjump", oProxyJump },
322 { "protocolkeepalives", oProtocolKeepAlives },
323 { "setuptimeout", oSetupTimeOut },
321 324
322 { NULL, oBadOption } 325 { NULL, oBadOption }
323}; 326};
@@ -1406,6 +1409,8 @@ parse_keytypes:
1406 goto parse_flag; 1409 goto parse_flag;
1407 1410
1408 case oServerAliveInterval: 1411 case oServerAliveInterval:
1412 case oProtocolKeepAlives: /* Debian-specific compatibility alias */
1413 case oSetupTimeOut: /* Debian-specific compatibility alias */
1409 intptr = &options->server_alive_interval; 1414 intptr = &options->server_alive_interval;
1410 goto parse_time; 1415 goto parse_time;
1411 1416
@@ -2042,8 +2047,13 @@ fill_default_options(Options * options)
2042 options->rekey_interval = 0; 2047 options->rekey_interval = 0;
2043 if (options->verify_host_key_dns == -1) 2048 if (options->verify_host_key_dns == -1)
2044 options->verify_host_key_dns = 0; 2049 options->verify_host_key_dns = 0;
2045 if (options->server_alive_interval == -1) 2050 if (options->server_alive_interval == -1) {
2046 options->server_alive_interval = 0; 2051 /* in batch mode, default is 5mins */
2052 if (options->batch_mode == 1)
2053 options->server_alive_interval = 300;
2054 else
2055 options->server_alive_interval = 0;
2056 }
2047 if (options->server_alive_count_max == -1) 2057 if (options->server_alive_count_max == -1)
2048 options->server_alive_count_max = 3; 2058 options->server_alive_count_max = 3;
2049 if (options->control_master == -1) 2059 if (options->control_master == -1)