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>2015-11-29 17:36:18 +0000
commit5664b20b9d8ee691d664333b83ebb5e7560933a4 (patch)
tree0bf98865c38014f76c9b01b55de772ea897516e7 /readconf.c
parent5e3b425ba1e334c987c5e15abf3d90e9eb776ab3 (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 522ad373c..46c343f30 100644
--- a/readconf.c
+++ b/readconf.c
@@ -160,6 +160,7 @@ typedef enum {
160 oStreamLocalBindMask, oStreamLocalBindUnlink, oRevokedHostKeys, 160 oStreamLocalBindMask, oStreamLocalBindUnlink, oRevokedHostKeys,
161 oFingerprintHash, oUpdateHostkeys, oHostbasedKeyTypes, 161 oFingerprintHash, oUpdateHostkeys, oHostbasedKeyTypes,
162 oPubkeyAcceptedKeyTypes, 162 oPubkeyAcceptedKeyTypes,
163 oProtocolKeepAlives, oSetupTimeOut,
163 oIgnoredUnknownOption, oDeprecated, oUnsupported 164 oIgnoredUnknownOption, oDeprecated, oUnsupported
164} OpCodes; 165} OpCodes;
165 166
@@ -290,6 +291,8 @@ static struct {
290 { "hostbasedkeytypes", oHostbasedKeyTypes }, 291 { "hostbasedkeytypes", oHostbasedKeyTypes },
291 { "pubkeyacceptedkeytypes", oPubkeyAcceptedKeyTypes }, 292 { "pubkeyacceptedkeytypes", oPubkeyAcceptedKeyTypes },
292 { "ignoreunknown", oIgnoreUnknown }, 293 { "ignoreunknown", oIgnoreUnknown },
294 { "protocolkeepalives", oProtocolKeepAlives },
295 { "setuptimeout", oSetupTimeOut },
293 296
294 { NULL, oBadOption } 297 { NULL, oBadOption }
295}; 298};
@@ -1304,6 +1307,8 @@ parse_keytypes:
1304 goto parse_flag; 1307 goto parse_flag;
1305 1308
1306 case oServerAliveInterval: 1309 case oServerAliveInterval:
1310 case oProtocolKeepAlives: /* Debian-specific compatibility alias */
1311 case oSetupTimeOut: /* Debian-specific compatibility alias */
1307 intptr = &options->server_alive_interval; 1312 intptr = &options->server_alive_interval;
1308 goto parse_time; 1313 goto parse_time;
1309 1314
@@ -1856,8 +1861,13 @@ fill_default_options(Options * options)
1856 options->rekey_interval = 0; 1861 options->rekey_interval = 0;
1857 if (options->verify_host_key_dns == -1) 1862 if (options->verify_host_key_dns == -1)
1858 options->verify_host_key_dns = 0; 1863 options->verify_host_key_dns = 0;
1859 if (options->server_alive_interval == -1) 1864 if (options->server_alive_interval == -1) {
1860 options->server_alive_interval = 0; 1865 /* in batch mode, default is 5mins */
1866 if (options->batch_mode == 1)
1867 options->server_alive_interval = 300;
1868 else
1869 options->server_alive_interval = 0;
1870 }
1861 if (options->server_alive_count_max == -1) 1871 if (options->server_alive_count_max == -1)
1862 options->server_alive_count_max = 3; 1872 options->server_alive_count_max = 3;
1863 if (options->control_master == -1) 1873 if (options->control_master == -1)