| Summary: | X11 applications can sometimes not connect to 127.0.0.1:60xx | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | Portable OpenSSH | Reporter: | Christian Plattner <plattner> | ||||||
| Component: | sshd | Assignee: | Damien Miller <djm> | ||||||
| Status: | CLOSED FIXED | ||||||||
| Severity: | normal | CC: | t8m | ||||||
| Priority: | P2 | ||||||||
| Version: | -current | ||||||||
| Hardware: | ix86 | ||||||||
| OS: | Linux | ||||||||
| Bug Depends on: | |||||||||
| Bug Blocks: | 1047 | ||||||||
| Attachments: |
|
||||||||
|
Description
Christian Plattner
2005-08-27 04:31:09 AEST
Here is a part of netstat output if everything is fine (OpenSSH is ready to forward X11 connections) Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 127.0.0.1:6010 0.0.0.0:* LISTEN tcp 0 0 ::1:6010 :::* LISTEN Here is a part of netstat output when things went wrong (OpenSSH thinks it is ready to forward X11 connections =) Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 127.0.0.1:6010 127.0.0.1:54806 TIME_WAIT tcp 0 0 ::1:6010 :::* LISTEN Created attachment 956 [details]
Set SO_REUSEADDR for X11 sockets too
Please test this patch - it sets SO_REUSEADDR for X11 listeners
Created attachment 958 [details]
Different patch
This patch prevents openssh from using ports which are already partially in use
(on IPv4 but not on IPv6) for X11 forwarding.
I only tested the first patch (the one which sets SO_REUSEADDR on the X11 socket before binding it) and that resolves the problem. Thanks! Tested with: openssh-SNAP-20050919.tar.gz on Fedora Core 4 (2.6.12-1.1447_FC4smp). SO_REUSEADDR patch applied and will be in OpenSSH 4.3. Change all RESOLVED bug to CLOSED with the exception of the ones fixed post-4.4. |