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>2014-10-07 14:26:47 +0100
commitbd3abc2f732da3a61e4158b915480808957a4357 (patch)
treeaaf782fab71ffb0cb4579105a143e22a54975376 /readconf.c
parentcbbc8577950b93090171c7394bcdeb68b7c3cd0c (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: 2014-10-07 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 bc879eb9b..337818c63 100644
--- a/readconf.c
+++ b/readconf.c
@@ -153,6 +153,7 @@ typedef enum {
153 oCanonicalDomains, oCanonicalizeHostname, oCanonicalizeMaxDots, 153 oCanonicalDomains, oCanonicalizeHostname, oCanonicalizeMaxDots,
154 oCanonicalizeFallbackLocal, oCanonicalizePermittedCNAMEs, 154 oCanonicalizeFallbackLocal, oCanonicalizePermittedCNAMEs,
155 oStreamLocalBindMask, oStreamLocalBindUnlink, 155 oStreamLocalBindMask, oStreamLocalBindUnlink,
156 oProtocolKeepAlives, oSetupTimeOut,
156 oIgnoredUnknownOption, oDeprecated, oUnsupported 157 oIgnoredUnknownOption, oDeprecated, oUnsupported
157} OpCodes; 158} OpCodes;
158 159
@@ -278,6 +279,8 @@ static struct {
278 { "streamlocalbindmask", oStreamLocalBindMask }, 279 { "streamlocalbindmask", oStreamLocalBindMask },
279 { "streamlocalbindunlink", oStreamLocalBindUnlink }, 280 { "streamlocalbindunlink", oStreamLocalBindUnlink },
280 { "ignoreunknown", oIgnoreUnknown }, 281 { "ignoreunknown", oIgnoreUnknown },
282 { "protocolkeepalives", oProtocolKeepAlives },
283 { "setuptimeout", oSetupTimeOut },
281 284
282 { NULL, oBadOption } 285 { NULL, oBadOption }
283}; 286};
@@ -1271,6 +1274,8 @@ parse_int:
1271 goto parse_flag; 1274 goto parse_flag;
1272 1275
1273 case oServerAliveInterval: 1276 case oServerAliveInterval:
1277 case oProtocolKeepAlives: /* Debian-specific compatibility alias */
1278 case oSetupTimeOut: /* Debian-specific compatibility alias */
1274 intptr = &options->server_alive_interval; 1279 intptr = &options->server_alive_interval;
1275 goto parse_time; 1280 goto parse_time;
1276 1281
@@ -1791,8 +1796,13 @@ fill_default_options(Options * options)
1791 options->rekey_interval = 0; 1796 options->rekey_interval = 0;
1792 if (options->verify_host_key_dns == -1) 1797 if (options->verify_host_key_dns == -1)
1793 options->verify_host_key_dns = 0; 1798 options->verify_host_key_dns = 0;
1794 if (options->server_alive_interval == -1) 1799 if (options->server_alive_interval == -1) {
1795 options->server_alive_interval = 0; 1800 /* in batch mode, default is 5mins */
1801 if (options->batch_mode == 1)
1802 options->server_alive_interval = 300;
1803 else
1804 options->server_alive_interval = 0;
1805 }
1796 if (options->server_alive_count_max == -1) 1806 if (options->server_alive_count_max == -1)
1797 options->server_alive_count_max = 3; 1807 options->server_alive_count_max = 3;
1798 if (options->control_master == -1) 1808 if (options->control_master == -1)