remote forwarding in 2.9p2

Philippe Levan levan at epix.net
Wed Jul 4 11:56:22 EST 2001


Hi,

It looks like remote forwarding with SSH v2 is not working
on my Solaris machines (and from what I understand from the
source, it may not work elsewhere either).

When looking at channel_post_port_listener() in channels.c,
I found that nextstate was defined as :

		nextstate = (c->host_port == 0) ? SSH_CHANNEL_DYNAMIC :
		    SSH_CHANNEL_OPENING;

And later comes the call :

		if (nextstate != SSH_CHANNEL_DYNAMIC)
			port_open_helper(nc, rtype);

It turns out that on the server-side, for a channel type
of SSH_CHANNEL_RPORT_LISTENER, c->host_port is 0 and therefore,
per the above code, nextstate == SSH_CHANNEL_DYNAMIC and
port_open_helper() is not called.

I am not sure what the function of SSH_CHANNEL_DYNAMIC is but
it looks like it has something to do with socks4 (from looking
at channel_pre_dynamic()) and probably doesn't apply to the
SSH_CHANNEL_RPORT_LISTENER case. I suspect that nextstate should
be SSH_CHANNEL_OPENING in order to call port_open_helper().

I tried to make the change :

		nextstate = (c->type == SSH_CHANNEL_RPORT_LISTENER) ?
		    SSH_CHANNEL_OPENING :
		    (c->host_port == 0) ? SSH_CHANNEL_DYNAMIC :
		    SSH_CHANNEL_OPENING;

And that seems to work.

Anyone care to check and confirm the fix or point me in the
right direction ?

Thanks.

			Philippe.

---
Philippe Levan | Systems Engineering
levan at epix.net | epix Internet Services




More information about the openssh-unix-dev mailing list