X forwarding: trying to forward to busy local port

Lars Kruse kruse at silicann.com
Wed Feb 14 21:43:22 EST 2007


Hi,

> > 1) improved "is this port usable on all interfaces?"-detection
> > ipv4/ipv6 mixed openssh daemons should behave like pure ipv4 daemons:
> > unusable DISPLAY settings may never be offered to clients
> 
> I think it's a Linuxism: IPv6 sockets prevent binding to IPv4 sockets
> on the same port but not vice versa.
hm - I do not know any details regarding this behaviour ...

To make sure, that you understand me right, I was studying the source
code of "x11_create_display_inet" in "channel.c" again.
If I am not mistaken, then the loop
   for (ai = aitop; ai; ai = ai->ai_next)
tries to connect to all available ports according to the given
restrictions (especially: address family). If at least one port is
usable, then this one is used for the X session.


Case 1: both ipv4 and ipv6 socket of a given port are available
no problem - both sockets are bound for the X session.

Case 2: only the ipv4 socket of the port is available
no problem - as the display "localhost:???" (ipv4 address) is returned,
clients will only connect to the ipv4 port, anyway.

Case 3: only the ipv6 socket of the port is available
this seems to be a problem: an ipv6 port is bound, but an ipv4 address
is returned as the display setting (DISPLAY=localhost:??? instead of
DISPLAY=ip6-localhost:???).


Could it be, that the return value of the DISPLAY setting does not
depend on the acquired sockets for now? (always returning an ip4
address)

Or did I misunderstand something?

regards,
Lars


More information about the openssh-unix-dev mailing list