changeset 968:f7f6c15b0ec3

Don't send SSH_MSG_UNIMPLEMENTED for keepalive responses
author Matt Johnston <matt@ucc.asn.au>
date Wed, 13 Aug 2014 21:48:47 +0800
parents 02821319ab1f
children 939944f0fca9
files cli-session.c common-session.c session.h svr-session.c
diffstat 4 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/cli-session.c	Fri Aug 08 21:53:47 2014 +0800
+++ b/cli-session.c	Wed Aug 13 21:48:47 2014 +0800
@@ -73,6 +73,8 @@
 #ifdef  ENABLE_CLI_REMOTETCPFWD
 	{SSH_MSG_REQUEST_SUCCESS, cli_recv_msg_request_success}, /* client */
 	{SSH_MSG_REQUEST_FAILURE, cli_recv_msg_request_failure}, /* client */
+#else
+	{SSH_MSG_REQUEST_FAILURE, ignore_recv_msg_request_failure}, /* for keepalive */
 #endif
 	{0, 0} /* End */
 };
--- a/common-session.c	Fri Aug 08 21:53:47 2014 +0800
+++ b/common-session.c	Wed Aug 13 21:48:47 2014 +0800
@@ -394,6 +394,11 @@
 	return pos+1;
 }
 
+void ignore_recv_msg_request_failure() {
+	// Do nothing
+	TRACE(("Ignored msg_request_failure"))
+}
+
 static void send_msg_keepalive() {
 	CHECKCLEARTOWRITE();
 	time_t old_time_idle = ses.last_packet_time_idle;
--- a/session.h	Fri Aug 08 21:53:47 2014 +0800
+++ b/session.h	Wed Aug 13 21:48:47 2014 +0800
@@ -47,6 +47,7 @@
 void session_cleanup();
 void send_session_identification();
 void send_msg_ignore();
+void ignore_recv_msg_request_failure();
 
 void update_channel_prio();
 
--- a/svr-session.c	Fri Aug 08 21:53:47 2014 +0800
+++ b/svr-session.c	Wed Aug 13 21:48:47 2014 +0800
@@ -58,6 +58,7 @@
 	{SSH_MSG_CHANNEL_OPEN, recv_msg_channel_open},
 	{SSH_MSG_CHANNEL_EOF, recv_msg_channel_eof},
 	{SSH_MSG_CHANNEL_CLOSE, recv_msg_channel_close},
+	{SSH_MSG_REQUEST_FAILURE, ignore_recv_msg_request_failure}, /* for keepalive */
 #ifdef USING_LISTENERS
 	{SSH_MSG_CHANNEL_OPEN_CONFIRMATION, recv_msg_channel_open_confirmation},
 	{SSH_MSG_CHANNEL_OPEN_FAILURE, recv_msg_channel_open_failure},