diff options
author | 2002-04-22 21:04:52 +0000 | |
---|---|---|
committer | 2002-04-22 21:04:52 +0000 | |
commit | 86b28bfab31e9ded2860cc469a088a8212ce3c33 (patch) | |
tree | 5988c81e76234d99190652e85dd40952ea3a2407 /usr.bin/ssh/ssh.c | |
parent | Bring several stability and performance fixes from NetBSD, as well as (diff) | |
download | wireguard-openbsd-86b28bfab31e9ded2860cc469a088a8212ce3c33.tar.xz wireguard-openbsd-86b28bfab31e9ded2860cc469a088a8212ce3c33.zip |
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 'usr.bin/ssh/ssh.c')
-rw-r--r-- | usr.bin/ssh/ssh.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/usr.bin/ssh/ssh.c b/usr.bin/ssh/ssh.c index 1c491119b9b..ae34892dbae 100644 --- a/usr.bin/ssh/ssh.c +++ b/usr.bin/ssh/ssh.c @@ -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> @@ -138,6 +138,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 @@ -1021,6 +1024,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) |