LocalForward and RemoteForward bind patch

Ben Lindstrom mouring at etoh.eviladmin.org
Fri Aug 6 13:34:49 EST 2004



On Fri, 6 Aug 2004, Damien Miller wrote:

> Jeff Hansen wrote:
>
> > FINALLY, it's here.
> >
> > You can now tell SSH which address to bind to for every single port
> > forwarding option!  This patch allows you to pass the following as ssh
> > command line options:
>
> There has been a patch to do just this for a little while. It just
> needs testing before we merge it.
>
> http://bugzilla.mindrot.org/show_bug.cgi?id=413
>
[.. in channels.c ..]
@@ -2312,7 +2333,14 @@

 	/* Send the forward request to the remote side. */
 	if (compat20) {
-		const char *address_to_bind = "0.0.0.0";
+		const char *address_to_bind;
+		if (listen_host == NULL)
+			address_to_bind = "127.0.0.1";
+		else if (listen_host[0] == '\0' || strcmp(listen_host,
"*")==0)
[..]

Ain't it a bit wrong to hard code 127.0.0.1 here without consulting if we
are in ipv4 vs ipv6 mode?   I assume this would break if the person is
assuming pure ipv6 connection everywhere.

- Ben





More information about the openssh-unix-dev mailing list