problem with X11 forwarding and use_localhost on Linux (solution)

Stig Venaas Stig.Venaas at uninett.no
Mon Apr 29 19:32:21 EST 2002


On Thu, Apr 25, 2002 at 10:09:40AM -0700, Kevin Steves wrote:
> : #else
> :-                       break;
> :+                       if (!x11_use_localhost || num_socks == NUM_SOCKS)
> :+                               break;
> : #endif
> :                }
> :                freeaddrinfo(aitop);
> 
> this is what is in:
> http://bugzilla.mindrot.org/show_bug.cgi?id=164

Right, I should have checked there.

> i still don't understand exactly why DONT_TRY_OTHER_AF is needed?

It's needed because if you first bind an IPv6 socket to the ANY address,
then subsequent IPv4 bind will fail on Linux. You could of course remove
DONT_TRY_OTHER_AF, but then you need to ignore the error on the IPv4 bind
call. Currently it will clean up (closing the already opened IPv6 socket),
and then try the next display (which will again fail) until MAX_DISPLAYS
is reached, and it will then simply fail. If the code for the ANY case
was separated from the x11_use_localhost case, you would only need
DONT_TRY_OTHER_AF in the ANY part, that is the only part where Linux is
different from *BSD.

Stig



More information about the openssh-unix-dev mailing list