mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-07 18:50:27 +09:00
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:
committed by
Andreas Schneider
parent
26ea4f059a
commit
906f63ba97
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user