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>2019-06-05 13:11:52 +0100
commit4d8dd12bab7bbc954815d7953a0c86ce1687bd34 (patch)
tree42aa35bfed4031c8b4c5cdd8d8a37665031216ae /readconf.c
parent0138f331a73d692f4543477ce7f64f9ede7d6b08 (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: 2018-10-19 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 29f3bd98d..3d0b6ff90 100644
--- a/readconf.c
+++ b/readconf.c
@@ -177,6 +177,7 @@ typedef enum {
177 oStreamLocalBindMask, oStreamLocalBindUnlink, oRevokedHostKeys, 177 oStreamLocalBindMask, oStreamLocalBindUnlink, oRevokedHostKeys,
178 oFingerprintHash, oUpdateHostkeys, oHostbasedKeyTypes, 178 oFingerprintHash, oUpdateHostkeys, oHostbasedKeyTypes,
179 oPubkeyAcceptedKeyTypes, oCASignatureAlgorithms, oProxyJump, 179 oPubkeyAcceptedKeyTypes, oCASignatureAlgorithms, oProxyJump,
180 oProtocolKeepAlives, oSetupTimeOut,
180 oIgnore, oIgnoredUnknownOption, oDeprecated, oUnsupported 181 oIgnore, oIgnoredUnknownOption, oDeprecated, oUnsupported
181} OpCodes; 182} OpCodes;
182 183
@@ -326,6 +327,8 @@ static struct {
326 { "pubkeyacceptedkeytypes", oPubkeyAcceptedKeyTypes }, 327 { "pubkeyacceptedkeytypes", oPubkeyAcceptedKeyTypes },
327 { "ignoreunknown", oIgnoreUnknown }, 328 { "ignoreunknown", oIgnoreUnknown },
328 { "proxyjump", oProxyJump }, 329 { "proxyjump", oProxyJump },
330 { "protocolkeepalives", oProtocolKeepAlives },
331 { "setuptimeout", oSetupTimeOut },
329 332
330 { NULL, oBadOption } 333 { NULL, oBadOption }
331}; 334};
@@ -1440,6 +1443,8 @@ parse_keytypes:
1440 goto parse_flag; 1443 goto parse_flag;
1441 1444
1442 case oServerAliveInterval: 1445 case oServerAliveInterval:
1446 case oProtocolKeepAlives: /* Debian-specific compatibility alias */
1447 case oSetupTimeOut: /* Debian-specific compatibility alias */
1443 intptr = &options->server_alive_interval; 1448 intptr = &options->server_alive_interval;
1444 goto parse_time; 1449 goto parse_time;
1445 1450
@@ -2133,8 +2138,13 @@ fill_default_options(Options * options)
2133 options->rekey_interval = 0; 2138 options->rekey_interval = 0;
2134 if (options->verify_host_key_dns == -1) 2139 if (options->verify_host_key_dns == -1)
2135 options->verify_host_key_dns = 0; 2140 options->verify_host_key_dns = 0;
2136 if (options->server_alive_interval == -1) 2141 if (options->server_alive_interval == -1) {
2137 options->server_alive_interval = 0; 2142 /* in batch mode, default is 5mins */
2143 if (options->batch_mode == 1)
2144 options->server_alive_interval = 300;
2145 else
2146 options->server_alive_interval = 0;
2147 }
2138 if (options->server_alive_count_max == -1) 2148 if (options->server_alive_count_max == -1)
2139 options->server_alive_count_max = 3; 2149 options->server_alive_count_max = 3;
2140 if (options->control_master == -1) 2150 if (options->control_master == -1)