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>2016-02-29 12:33:29 +0000
commita9c7a3f8b035fe820fd32283460b1a28e696d2fe (patch)
tree2222e0f6aeea8b13b9bfe825a0e14f850e5be321 /readconf.c
parent68e8163d9209f731c582fe5350002c51c9551983 (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: 2015-11-29 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 559e4c7d0..fde6b418a 100644
--- a/readconf.c
+++ b/readconf.c
@@ -161,6 +161,7 @@ typedef enum {
161 oStreamLocalBindMask, oStreamLocalBindUnlink, oRevokedHostKeys, 161 oStreamLocalBindMask, oStreamLocalBindUnlink, oRevokedHostKeys,
162 oFingerprintHash, oUpdateHostkeys, oHostbasedKeyTypes, 162 oFingerprintHash, oUpdateHostkeys, oHostbasedKeyTypes,
163 oPubkeyAcceptedKeyTypes, 163 oPubkeyAcceptedKeyTypes,
164 oProtocolKeepAlives, oSetupTimeOut,
164 oIgnoredUnknownOption, oDeprecated, oUnsupported 165 oIgnoredUnknownOption, oDeprecated, oUnsupported
165} OpCodes; 166} OpCodes;
166 167
@@ -293,6 +294,8 @@ static struct {
293 { "hostbasedkeytypes", oHostbasedKeyTypes }, 294 { "hostbasedkeytypes", oHostbasedKeyTypes },
294 { "pubkeyacceptedkeytypes", oPubkeyAcceptedKeyTypes }, 295 { "pubkeyacceptedkeytypes", oPubkeyAcceptedKeyTypes },
295 { "ignoreunknown", oIgnoreUnknown }, 296 { "ignoreunknown", oIgnoreUnknown },
297 { "protocolkeepalives", oProtocolKeepAlives },
298 { "setuptimeout", oSetupTimeOut },
296 299
297 { NULL, oBadOption } 300 { NULL, oBadOption }
298}; 301};
@@ -1350,6 +1353,8 @@ parse_keytypes:
1350 goto parse_flag; 1353 goto parse_flag;
1351 1354
1352 case oServerAliveInterval: 1355 case oServerAliveInterval:
1356 case oProtocolKeepAlives: /* Debian-specific compatibility alias */
1357 case oSetupTimeOut: /* Debian-specific compatibility alias */
1353 intptr = &options->server_alive_interval; 1358 intptr = &options->server_alive_interval;
1354 goto parse_time; 1359 goto parse_time;
1355 1360
@@ -1906,8 +1911,13 @@ fill_default_options(Options * options)
1906 options->rekey_interval = 0; 1911 options->rekey_interval = 0;
1907 if (options->verify_host_key_dns == -1) 1912 if (options->verify_host_key_dns == -1)
1908 options->verify_host_key_dns = 0; 1913 options->verify_host_key_dns = 0;
1909 if (options->server_alive_interval == -1) 1914 if (options->server_alive_interval == -1) {
1910 options->server_alive_interval = 0; 1915 /* in batch mode, default is 5mins */
1916 if (options->batch_mode == 1)
1917 options->server_alive_interval = 300;
1918 else
1919 options->server_alive_interval = 0;
1920 }
1911 if (options->server_alive_count_max == -1) 1921 if (options->server_alive_count_max == -1)
1912 options->server_alive_count_max = 3; 1922 options->server_alive_count_max = 3;
1913 if (options->control_master == -1) 1923 if (options->control_master == -1)