2.9: remote port forwarding doesn't work

Markus Friedl markus.friedl at informatik.uni-erlangen.de
Thu May 10 08:51:00 EST 2001


On Tue, May 09, 2000 at 08:55:25AM -0700, Gregory Steuck wrote:
> Hello,
> 
> I'm running OpenBSD 2.9 (-rOPENBSD_2_9) on i386. Remote port forwarding
> doesn't work. Attached are 2 logs of
> ssh -v -R2828:localhost:22 localhost
> and
> sshd -p 2222  -d
> 
> Note that server tries to forward to
> Connection to port 2828 forwarding to 0.0.0.0 port 0 requested.
> instead of localhost port 22 as it should.

please, try this:


Index: channels.c
===================================================================
RCS file: /home/markus/cvs/ssh/channels.c,v
retrieving revision 1.114
diff -u -r1.114 channels.c
--- channels.c	2001/05/08 19:17:30	1.114
+++ channels.c	2001/05/09 22:46:11
@@ -771,8 +771,9 @@
 
 		rtype = (c->type == SSH_CHANNEL_RPORT_LISTENER) ?
 		    "forwarded-tcpip" : "direct-tcpip";
-		nextstate = (c->host_port == 0) ? SSH_CHANNEL_DYNAMIC :
-		    SSH_CHANNEL_OPENING;
+		nextstate = (c->host_port == 0 &&
+		    c->type != SSH_CHANNEL_RPORT_LISTENER) ?
+		    SSH_CHANNEL_DYNAMIC : SSH_CHANNEL_OPENING;
 
 		addrlen = sizeof(addr);
 		newsock = accept(c->sock, &addr, &addrlen);



More information about the openssh-unix-dev mailing list