diff options
Diffstat (limited to 'debian/patches/ssh1-keepalive.patch')
-rw-r--r-- | debian/patches/ssh1-keepalive.patch | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/debian/patches/ssh1-keepalive.patch b/debian/patches/ssh1-keepalive.patch new file mode 100644 index 000000000..ccd9a668e --- /dev/null +++ b/debian/patches/ssh1-keepalive.patch | |||
@@ -0,0 +1,66 @@ | |||
1 | Description: Partial server keep-alive implementation for SSH1 | ||
2 | Author: Colin Watson <cjwatson@debian.org> | ||
3 | Bug: https://bugzilla.mindrot.org/show_bug.cgi?id=1712 | ||
4 | Last-Update: 2010-02-27 | ||
5 | |||
6 | Index: b/clientloop.c | ||
7 | =================================================================== | ||
8 | --- a/clientloop.c | ||
9 | +++ b/clientloop.c | ||
10 | @@ -507,16 +507,21 @@ | ||
11 | static void | ||
12 | server_alive_check(void) | ||
13 | { | ||
14 | - if (packet_inc_alive_timeouts() > options.server_alive_count_max) { | ||
15 | - logit("Timeout, server not responding."); | ||
16 | - cleanup_exit(255); | ||
17 | - } | ||
18 | - packet_start(SSH2_MSG_GLOBAL_REQUEST); | ||
19 | - packet_put_cstring("keepalive@openssh.com"); | ||
20 | - packet_put_char(1); /* boolean: want reply */ | ||
21 | - packet_send(); | ||
22 | - /* Insert an empty placeholder to maintain ordering */ | ||
23 | - client_register_global_confirm(NULL, NULL); | ||
24 | + if (compat20) { | ||
25 | + if (packet_inc_alive_timeouts() > options.server_alive_count_max) { | ||
26 | + logit("Timeout, server not responding."); | ||
27 | + cleanup_exit(255); | ||
28 | + } | ||
29 | + packet_start(SSH2_MSG_GLOBAL_REQUEST); | ||
30 | + packet_put_cstring("keepalive@openssh.com"); | ||
31 | + packet_put_char(1); /* boolean: want reply */ | ||
32 | + packet_send(); | ||
33 | + /* Insert an empty placeholder to maintain ordering */ | ||
34 | + client_register_global_confirm(NULL, NULL); | ||
35 | + } else { | ||
36 | + packet_send_ignore(0); | ||
37 | + packet_send(); | ||
38 | + } | ||
39 | } | ||
40 | |||
41 | /* | ||
42 | @@ -574,7 +579,7 @@ | ||
43 | * event pending. | ||
44 | */ | ||
45 | |||
46 | - if (options.server_alive_interval == 0 || !compat20) | ||
47 | + if (options.server_alive_interval == 0) | ||
48 | tvp = NULL; | ||
49 | else { | ||
50 | tv.tv_sec = options.server_alive_interval; | ||
51 | Index: b/ssh_config.5 | ||
52 | =================================================================== | ||
53 | --- a/ssh_config.5 | ||
54 | +++ b/ssh_config.5 | ||
55 | @@ -956,7 +956,10 @@ | ||
56 | .Cm ServerAliveCountMax | ||
57 | is left at the default, if the server becomes unresponsive, | ||
58 | ssh will disconnect after approximately 45 seconds. | ||
59 | -This option applies to protocol version 2 only. | ||
60 | +This option applies to protocol version 2 only; in protocol version | ||
61 | +1 there is no mechanism to request a response from the server to the | ||
62 | +server alive messages, so disconnection is the responsibility of the TCP | ||
63 | +stack. | ||
64 | .It Cm ServerAliveInterval | ||
65 | Sets a timeout interval in seconds after which if no data has been received | ||
66 | from the server, | ||