packets: Fix ssh_send_keepalive()

ssh_send_keepalive() should use global_request() to properly configure
the state machine for packet filtering.

Signed-off-by: Nicolas Viennot <nicolas@viennot.biz>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit 59ada799d7)
This commit is contained in:
Nicolas Viennot
2018-11-18 20:54:13 -05:00
committed by Andreas Schneider
parent 26ea4f059a
commit 906f63ba97
3 changed files with 14 additions and 27 deletions

View File

@@ -2082,8 +2082,11 @@ static int ssh_global_request_termination(void *s){
* SSH_AGAIN if in nonblocking mode and call has
* to be done again.
*/
static int global_request(ssh_session session, const char *request,
ssh_buffer buffer, int reply) {
int ssh_global_request(ssh_session session,
const char *request,
ssh_buffer buffer,
int reply)
{
int rc;
switch (session->global_req_state) {
@@ -2214,7 +2217,7 @@ int ssh_channel_listen_forward(ssh_session session,
goto error;
}
pending:
rc = global_request(session, "tcpip-forward", buffer, 1);
rc = ssh_global_request(session, "tcpip-forward", buffer, 1);
/* TODO: FIXME no guarantee the last packet we received contains
* that info */
@@ -2294,7 +2297,7 @@ int ssh_channel_cancel_forward(ssh_session session,
goto error;
}
pending:
rc = global_request(session, "cancel-tcpip-forward", buffer, 1);
rc = ssh_global_request(session, "cancel-tcpip-forward", buffer, 1);
error:
ssh_buffer_free(buffer);