diff options
author | Damien Miller <djm@mindrot.org> | 2002-04-23 21:09:44 +1000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2002-04-23 21:09:44 +1000 |
commit | 2797f7f03a6aecfaaf2dadb1284b4b51869339d6 (patch) | |
tree | 3abe68f5830195c04c3db25ad2adf0eee8254529 /ssh.c | |
parent | d7de14b6ada79812cf3a1ceb8f921d92d4d180be (diff) | |
download | openssh-git-2797f7f03a6aecfaaf2dadb1284b4b51869339d6.tar.gz |
- markus@cvs.openbsd.org 2002/04/22 21:04:52
[channels.c clientloop.c clientloop.h ssh.c]
request reply (success/failure) for -R style fwd in protocol v2,
depends on ordered replies.
fixes http://bugzilla.mindrot.org/show_bug.cgi?id=215; ok provos@
Diffstat (limited to 'ssh.c')
-rw-r--r-- | ssh.c | 26 |
1 files changed, 25 insertions, 1 deletions
@@ -40,7 +40,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: ssh.c,v 1.169 2002/03/26 11:37:05 markus Exp $"); +RCSID("$OpenBSD: ssh.c,v 1.170 2002/04/22 21:04:52 markus Exp $"); #include <openssl/evp.h> #include <openssl/err.h> @@ -146,6 +146,9 @@ Buffer command; /* Should we execute a command or invoke a subsystem? */ int subsystem_flag = 0; +/* # of replies received for global requests */ +static int client_global_request_id = 0; + /* Prints a help message to the user. This function never returns. */ static void @@ -1041,6 +1044,27 @@ client_subsystem_reply(int type, u_int32_t seq, void *ctxt) len, (u_char *)buffer_ptr(&command), id); } +void +client_global_request_reply(int type, u_int32_t seq, void *ctxt) +{ + int i; + + i = client_global_request_id++; + if (i >= options.num_remote_forwards) { + debug("client_global_request_reply: too many replies %d > %d", + i, options.num_remote_forwards); + return; + } + debug("remote forward %s for: listen %d, connect %s:%d", + type == SSH2_MSG_REQUEST_SUCCESS ? "success" : "failure", + options.remote_forwards[i].port, + options.remote_forwards[i].host, + options.remote_forwards[i].host_port); + if (type == SSH2_MSG_REQUEST_FAILURE) + log("Warning: remote port forwarding failed for listen port %d", + options.remote_forwards[i].port); +} + /* request pty/x11/agent/tcpfwd/shell for channel */ static void ssh_session2_setup(int id, void *arg) |