summaryrefslogtreecommitdiff
path: root/packet.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2007-12-29 02:45:07 +1100
committerDarren Tucker <dtucker@zip.com.au>2007-12-29 02:45:07 +1100
commitd6725f04e296135732e9366a762222a3f3fd801f (patch)
tree6d86f4912d24a648bdef8301a93dd72cda60d6fd /packet.c
parent4abde771b73f3a54780ff3dedf59f57f94298870 (diff)
- dtucker@cvs.openbsd.org 2007/12/28 15:32:24
[clientloop.c serverloop.c packet.c] Make SSH2_MSG_UNIMPLEMENTED and SSH2_MSG_IGNORE messages reset the ServerAlive and ClientAlive timers. Prevents dropping a connection when these are enabled but the peer does not support our keepalives. bz #1307, ok djm@.
Diffstat (limited to 'packet.c')
-rw-r--r--packet.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/packet.c b/packet.c
index f82a63c47..561fbf4c9 100644
--- a/packet.c
+++ b/packet.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: packet.c,v 1.148 2007/06/07 19:37:34 pvalchev Exp $ */ 1/* $OpenBSD: packet.c,v 1.149 2007/12/28 15:32:24 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
@@ -968,9 +968,10 @@ packet_read_expect(int expected_type)
968 * packet_process_incoming. If so, reads the packet; otherwise returns 968 * packet_process_incoming. If so, reads the packet; otherwise returns
969 * SSH_MSG_NONE. This does not wait for data from the connection. 969 * SSH_MSG_NONE. This does not wait for data from the connection.
970 * 970 *
971 * SSH_MSG_DISCONNECT is handled specially here. Also, 971 * SSH_MSG_DISCONNECT is handled specially here. Also, SSH_MSG_IGNORE
972 * SSH_MSG_IGNORE messages are skipped by this function and are never returned 972 * messages are skipped by this function and are never returned
973 * to higher levels. 973 * to higher levels, although SSH2_MSG_IGNORE are since they are needed
974 * for keepalives.
974 */ 975 */
975 976
976static int 977static int
@@ -1195,8 +1196,6 @@ packet_read_poll_seqnr(u_int32_t *seqnr_p)
1195 if (type) 1196 if (type)
1196 DBG(debug("received packet type %d", type)); 1197 DBG(debug("received packet type %d", type));
1197 switch (type) { 1198 switch (type) {
1198 case SSH2_MSG_IGNORE:
1199 break;
1200 case SSH2_MSG_DEBUG: 1199 case SSH2_MSG_DEBUG:
1201 packet_get_char(); 1200 packet_get_char();
1202 msg = packet_get_string(NULL); 1201 msg = packet_get_string(NULL);
@@ -1217,7 +1216,7 @@ packet_read_poll_seqnr(u_int32_t *seqnr_p)
1217 seqnr = packet_get_int(); 1216 seqnr = packet_get_int();
1218 debug("Received SSH2_MSG_UNIMPLEMENTED for %u", 1217 debug("Received SSH2_MSG_UNIMPLEMENTED for %u",
1219 seqnr); 1218 seqnr);
1220 break; 1219 /* FALLTHROUGH */
1221 default: 1220 default:
1222 return type; 1221 return type;
1223 } 1222 }