Bug 597 - X11 Forwarding: sshd doesn't listen on unix domain sockets
Summary: X11 Forwarding: sshd doesn't listen on unix domain sockets
Status: CLOSED INVALID
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: sshd (show other bugs)
Version: -current
Hardware: All All
: P2 enhancement
Assignee: OpenSSH Bugzilla mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-06-18 01:42 AEST by ajax
Modified: 2004-04-14 12:24 AEST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ajax 2003-06-18 01:42:06 AEST
on some operating systems there is a performance benefit to using PF_UNIX
sockets instead of just 127.0.0.1:6010.  sshd should support this if possible.

a simple patch would just add this to channels.c:x11_create_display_inet(), but
i'm not sure that's the Right Thing.  you would want to be able to get both
127.0.0.1:6010 and /tmp/.X11-unix/X10 (incrementing the screen number until you
find a unique one), and then set DISPLAY=:10.0 if you got a unix domain socket.
 and you should probably also be able to configure sshd to not listen to unix
sockets (cygwin, ancient SysV machines, ...).

i'm working on a patch.  anything else i should consider?  i know there are
other "local" X transports on some SysV machines, but i'd have to check the X
source to see how that's done, and i'm not sure it's worth supporting.
Comment 1 Markus Friedl 2003-06-18 01:56:07 AEST
this is very unlikely because of this is very different among unices
and not portable.
Comment 2 Ben Lindstrom 2003-06-18 01:58:53 AEST
This is troublesome at best.  We already find some version of X that optimize 
their behavior when they see 'localhost' as their DISPLAY=.   I suspect you'll 
find a lot more that will do this type of optimization for UNIX domain sockets.
Comment 3 Damien Miller 2003-06-18 08:38:21 AEST
What performance benefit are you talking about? Most optimisations that X
servers perform when using unix domain sockets (shared memory, etc) are only
appropriate when the server and the client are on the same machine.

If you are referring to differing performance of TCP and unix domain sockets,
remember that such differences are likely to be small compared to encryption and
network delays.
Comment 4 Mike Mestnik 2003-07-23 13:35:51 AEST
I hope that every one will pull together and implement a library for dealing
with the issue Markus mentioned.  After all that's why we have APIs, YMMV.

Damien, shared memory has little to do with what type of socket you use :)  The
problem is not that X is bigger than Y, but that Y can be made smaller thus
effecting Z, where Y + X = Z.

on some operating systems there is a performance benefit to using PF_UNIX,
others will just direct you to some sort of network loopback or lack support :))

xlibs that support only XiG or XFree86 servers DO conflict with ssh, thay should
be replaced when using ssh -X.

I'd like to help, if there are any other problems in getting this into ssh drop
me a line.  I think taking some of a fully functionaly Xserver and making it
into a lib for it to share with ssh would be a big leap in the right direction.
 Any one mind the way Xfree86 sets up sockets and manages connections?
Comment 5 Damien Miller 2003-07-23 14:12:16 AEST
Again, please tell us what performance benefit you are expecting.

The difference between unix domain socket and local TCP socket latencies is in
the order of microseconds.
Comment 6 Ben Lindstrom 2003-08-14 12:26:37 AEST
Using Domain sockets will not improve anything. Reopen if you have a patch and 
hard proof this is even worth looking at.
Comment 7 Damien Miller 2004-04-14 12:24:19 AEST
Mass change of RESOLVED bugs to CLOSED