aboutsummaryrefslogtreecommitdiff
path: root/libssh/channels.c
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2010-03-01 18:54:52 +0100
committerAris Adamantiadis <aris@0xbadc0de.be>2010-03-01 18:54:52 +0100
commitb707b5e2a477669181ca2ebca7395d28fb0e3087 (patch)
tree803ac8233854cfabf891f00c5497d186be06d265 /libssh/channels.c
parentc987fd8c53b4ebabd8ca3d9b32216ac7f7ba6a9e (diff)
downloadlibssh-b707b5e2a477669181ca2ebca7395d28fb0e3087.tar.gz
libssh-b707b5e2a477669181ca2ebca7395d28fb0e3087.tar.xz
libssh-b707b5e2a477669181ca2ebca7395d28fb0e3087.zip
Answer to openssh's keepalives
Diffstat (limited to 'libssh/channels.c')
-rw-r--r--libssh/channels.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/libssh/channels.c b/libssh/channels.c
index c4e8168..7e4aa63 100644
--- a/libssh/channels.c
+++ b/libssh/channels.c
@@ -609,6 +609,15 @@ SSH_PACKET_CALLBACK(channel_rcv_request) {
leave_function();
return SSH_PACKET_USED;
}
+ if(strcmp(request,"keepalive@openssh.com")==0){
+ SAFE_FREE(request);
+ ssh_log(session, SSH_LOG_PROTOCOL,"Responding to Openssh's keepalive");
+ buffer_add_u8(session->out_buffer, SSH2_MSG_CHANNEL_SUCCESS);
+ buffer_add_u32(session->out_buffer, htonl(channel->remote_channel));
+ packet_send(session);
+ leave_function();
+ return SSH_PACKET_USED;
+ }
/* If we are here, that means we have a request that is not in the understood
* client requests. That means we need to create a ssh message to be passed