diff options
author | 2001-01-31 20:37:22 +0000 | |
---|---|---|
committer | 2001-01-31 20:37:22 +0000 | |
commit | 6b76b84db36a8cf9a2a610d287538b334f0b1111 (patch) | |
tree | 4dd8e0a9b705a0402c49ec6ea9ad54b355757280 /usr.bin/ssh/ssh.c | |
parent | make aware of UT_NAMESIZE (diff) | |
download | wireguard-openbsd-6b76b84db36a8cf9a2a610d287538b334f0b1111.tar.xz wireguard-openbsd-6b76b84db36a8cf9a2a610d287538b334f0b1111.zip |
do not disconnect if local port forwarding fails, e.g. if port is already in use
Diffstat (limited to 'usr.bin/ssh/ssh.c')
-rw-r--r-- | usr.bin/ssh/ssh.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/usr.bin/ssh/ssh.c b/usr.bin/ssh/ssh.c index 6e70e823e60..0f7d6f4d854 100644 --- a/usr.bin/ssh/ssh.c +++ b/usr.bin/ssh/ssh.c @@ -39,7 +39,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: ssh.c,v 1.85 2001/01/29 12:36:10 djm Exp $"); +RCSID("$OpenBSD: ssh.c,v 1.86 2001/01/31 20:37:23 markus Exp $"); #include <openssl/evp.h> #include <openssl/err.h> @@ -728,19 +728,23 @@ x11_get_proto(char *proto, int proto_len, char *data, int data_len) void ssh_init_forwarding(void) { + int success = 0; int i; + /* Initiate local TCP/IP port forwardings. */ for (i = 0; i < options.num_local_forwards; i++) { debug("Connections to local port %d forwarded to remote address %.200s:%d", options.local_forwards[i].port, options.local_forwards[i].host, options.local_forwards[i].host_port); - channel_request_local_forwarding( + success += channel_request_local_forwarding( options.local_forwards[i].port, options.local_forwards[i].host, options.local_forwards[i].host_port, options.gateway_ports); } + if (i > 0 && success == 0) + error("Could not request local forwarding."); /* Initiate remote TCP/IP port forwardings. */ for (i = 0; i < options.num_remote_forwards; i++) { |