summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--clientloop.c7
-rw-r--r--packet.c6
-rw-r--r--packet.h3
-rw-r--r--serverloop.c7
5 files changed, 18 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index 5a8d92bb4..533ee81cf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -21,6 +21,10 @@
21 [session.c] 21 [session.c]
22 closefrom() call was too early, delay it until just before we execute 22 closefrom() call was too early, delay it until just before we execute
23 the user's rc files (if any). 23 the user's rc files (if any).
24 - dtucker@cvs.openbsd.org 2008/02/22 20:44:02
25 [clientloop.c packet.c packet.h serverloop.c]
26 Allow all SSH2 packet types, including UNIMPLEMENTED to reset the
27 keepalive timer (bz #1307). ok markus@
24 28
2520080302 2920080302
26 - (dtucker) [configure.ac] FreeBSD's glob() doesn't behave the way we expect 30 - (dtucker) [configure.ac] FreeBSD's glob() doesn't behave the way we expect
@@ -3681,4 +3685,4 @@
3681 OpenServer 6 and add osr5bigcrypt support so when someone migrates 3685 OpenServer 6 and add osr5bigcrypt support so when someone migrates
3682 passwords between UnixWare and OpenServer they will still work. OK dtucker@ 3686 passwords between UnixWare and OpenServer they will still work. OK dtucker@
3683 3687
3684$Id: ChangeLog,v 1.4855 2008/03/07 07:33:12 djm Exp $ 3688$Id: ChangeLog,v 1.4856 2008/03/07 07:33:30 djm Exp $
diff --git a/clientloop.c b/clientloop.c
index d3fdc2bfc..8a40bc71e 100644
--- a/clientloop.c
+++ b/clientloop.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: clientloop.c,v 1.187 2008/01/23 01:56:54 dtucker Exp $ */ 1/* $OpenBSD: clientloop.c,v 1.188 2008/02/22 20:44:02 dtucker Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -157,7 +157,6 @@ static int connection_in; /* Connection to server (input). */
157static int connection_out; /* Connection to server (output). */ 157static int connection_out; /* Connection to server (output). */
158static int need_rekeying; /* Set to non-zero if rekeying is requested. */ 158static int need_rekeying; /* Set to non-zero if rekeying is requested. */
159static int session_closed = 0; /* In SSH2: login session closed. */ 159static int session_closed = 0; /* In SSH2: login session closed. */
160static int server_alive_timeouts = 0;
161 160
162static void client_init_dispatch(void); 161static void client_init_dispatch(void);
163int session_ident = -1; 162int session_ident = -1;
@@ -467,14 +466,14 @@ client_check_window_change(void)
467static void 466static void
468client_global_request_reply(int type, u_int32_t seq, void *ctxt) 467client_global_request_reply(int type, u_int32_t seq, void *ctxt)
469{ 468{
470 server_alive_timeouts = 0; 469 keep_alive_timeouts = 0;
471 client_global_request_reply_fwd(type, seq, ctxt); 470 client_global_request_reply_fwd(type, seq, ctxt);
472} 471}
473 472
474static void 473static void
475server_alive_check(void) 474server_alive_check(void)
476{ 475{
477 if (++server_alive_timeouts > options.server_alive_count_max) { 476 if (++keep_alive_timeouts > options.server_alive_count_max) {
478 logit("Timeout, server not responding."); 477 logit("Timeout, server not responding.");
479 cleanup_exit(255); 478 cleanup_exit(255);
480 } 479 }
diff --git a/packet.c b/packet.c
index 92997288d..6afe24b9f 100644
--- a/packet.c
+++ b/packet.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: packet.c,v 1.150 2008/01/23 01:56:54 dtucker Exp $ */ 1/* $OpenBSD: packet.c,v 1.151 2008/02/22 20:44:02 dtucker Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -136,6 +136,8 @@ static int server_side = 0;
136/* Set to true if we are authenticated. */ 136/* Set to true if we are authenticated. */
137static int after_authentication = 0; 137static int after_authentication = 0;
138 138
139int keep_alive_timeouts = 0;
140
139/* Session key information for Encryption and MAC */ 141/* Session key information for Encryption and MAC */
140Newkeys *newkeys[MODE_MAX]; 142Newkeys *newkeys[MODE_MAX];
141static struct packet_state { 143static struct packet_state {
@@ -1192,10 +1194,12 @@ packet_read_poll_seqnr(u_int32_t *seqnr_p)
1192 for (;;) { 1194 for (;;) {
1193 if (compat20) { 1195 if (compat20) {
1194 type = packet_read_poll2(seqnr_p); 1196 type = packet_read_poll2(seqnr_p);
1197 keep_alive_timeouts = 0;
1195 if (type) 1198 if (type)
1196 DBG(debug("received packet type %d", type)); 1199 DBG(debug("received packet type %d", type));
1197 switch (type) { 1200 switch (type) {
1198 case SSH2_MSG_IGNORE: 1201 case SSH2_MSG_IGNORE:
1202 debug3("Received SSH2_MSG_IGNORE");
1199 break; 1203 break;
1200 case SSH2_MSG_DEBUG: 1204 case SSH2_MSG_DEBUG:
1201 packet_get_char(); 1205 packet_get_char();
diff --git a/packet.h b/packet.h
index 21ff45067..c1b9b3bd1 100644
--- a/packet.h
+++ b/packet.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: packet.h,v 1.45 2006/03/25 22:22:43 djm Exp $ */ 1/* $OpenBSD: packet.h,v 1.46 2008/02/22 20:44:02 dtucker Exp $ */
2 2
3/* 3/*
4 * Author: Tatu Ylonen <ylo@cs.hut.fi> 4 * Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -86,6 +86,7 @@ void tty_make_modes(int, struct termios *);
86void tty_parse_modes(int, int *); 86void tty_parse_modes(int, int *);
87 87
88extern u_int max_packet_size; 88extern u_int max_packet_size;
89extern int keep_alive_timeouts;
89int packet_set_maxsize(u_int); 90int packet_set_maxsize(u_int);
90#define packet_get_maxsize() max_packet_size 91#define packet_get_maxsize() max_packet_size
91 92
diff --git a/serverloop.c b/serverloop.c
index 124d86c6e..bf3f9c9f0 100644
--- a/serverloop.c
+++ b/serverloop.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: serverloop.c,v 1.147 2008/01/23 01:56:54 dtucker Exp $ */ 1/* $OpenBSD: serverloop.c,v 1.148 2008/02/22 20:44:02 dtucker Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -104,7 +104,6 @@ static int connection_in; /* Connection to client (input). */
104static int connection_out; /* Connection to client (output). */ 104static int connection_out; /* Connection to client (output). */
105static int connection_closed = 0; /* Connection to client closed. */ 105static int connection_closed = 0; /* Connection to client closed. */
106static u_int buffer_high; /* "Soft" max buffer size. */ 106static u_int buffer_high; /* "Soft" max buffer size. */
107static int client_alive_timeouts = 0;
108 107
109/* 108/*
110 * This SIGCHLD kludge is used to detect when the child exits. The server 109 * This SIGCHLD kludge is used to detect when the child exits. The server
@@ -248,7 +247,7 @@ client_alive_check(void)
248 int channel_id; 247 int channel_id;
249 248
250 /* timeout, check to see how many we have had */ 249 /* timeout, check to see how many we have had */
251 if (++client_alive_timeouts > options.client_alive_count_max) { 250 if (++keep_alive_timeouts > options.client_alive_count_max) {
252 logit("Timeout, client not responding."); 251 logit("Timeout, client not responding.");
253 cleanup_exit(255); 252 cleanup_exit(255);
254 } 253 }
@@ -887,7 +886,7 @@ server_input_keep_alive(int type, u_int32_t seq, void *ctxt)
887 * even if this was generated by something other than 886 * even if this was generated by something other than
888 * the bogus CHANNEL_REQUEST we send for keepalives. 887 * the bogus CHANNEL_REQUEST we send for keepalives.
889 */ 888 */
890 client_alive_timeouts = 0; 889 keep_alive_timeouts = 0;
891} 890}
892 891
893static void 892static void