X forwarding: trying to forward to busy local port

Darren Tucker dtucker at zip.com.au
Thu Feb 8 14:18:37 EST 2007


Lars Kruse wrote:
> Hi,
> 
>> Do you have X11UseLocalhost set in sshd_config?  If so, what does
>> "localhost" resolve to?
> the setting "X11UseLocalhost" is not defined in our sshd_config - so it
> should be the default value "yes".
> 
>  jackdaw:~ # grep localhost /etc/hosts
>  127.0.0.1       localhost
>  ::1             ip6-localhost ip6-loopback
> 
> So "localhost" should resolve to the ipv4 address.

Not necessarily: if nsswitch.conf goes to DNS first you might resolve 
"localhost" to an AAAA record for ::1 (or alternate between IP4 and IP6, 
which might explain what you're seeing).

>> If you can afford to do so you could try running without the ipv6
>> stack loaded.
> good idea!
> I tried it ("AddressFamily inet") successfully: now busy ports are
> skipped (as expected).
> 
> 
> Maybe the ipv4 port should be checked in x11_create_display_inet, too?
> (if "AddressFamily" is "any")

I don't think that should be necessary: the system should return the 
sockets of the same AF when asked for the same thing (but glancing 
briefly at the code, sshd just passes a NULL address to getaddrinfo, so 
unless libc does a lookup for "localhost" I'm not sure what's really 
going on here.)

-- 
Darren Tucker (dtucker at zip.com.au)
GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4  37C9 C982 80C7 8FF4 FA69
     Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.


More information about the openssh-unix-dev mailing list