[Bug 1648] New: Fix IPV6_V6ONLY for -L with -g

bugzilla-daemon at bugzilla.mindrot.org bugzilla-daemon at bugzilla.mindrot.org
Sun Sep 13 23:58:47 EST 2009


https://bugzilla.mindrot.org/show_bug.cgi?id=1648

           Summary: Fix IPV6_V6ONLY for -L with -g
           Product: Portable OpenSSH
           Version: -current
          Platform: All
        OS/Version: Linux
            Status: NEW
          Severity: minor
          Priority: P2
         Component: ssh
        AssignedTo: unassigned-bugs at mindrot.org
        ReportedBy: jan.kratochvil at redhat.com


Created an attachment (id=1695)
 --> (https://bugzilla.mindrot.org/attachment.cgi?id=1695)
Fix following the current openssh style.

$ /usr/bin/ssh -g -L 5000:localhost:22 localhost cat
bind: Address already in use
[... running]
# netstat -apn|grep 5000
tcp  0  0  0.0.0.0:5000  0.0.0.0:*  LISTEN  23526/ssh
$ telnet localhost6 5000
Trying ::1...
telnet: connect to address ::1: Connection refused

patched:

$ ./ssh -g -L 5000:localhost:22 localhost cat
[... running]
# netstat -apn|grep 5000
tcp  0  0  0.0.0.0:5000  0.0.0.0:*  LISTEN  23139/ssh
tcp  0  0  :::5000       :::*       LISTEN  23139/ssh
$ telnet localhost6 5000
Trying ::1...
Connected to localhost6.
Escape character is '^]'.
SSH-2.0-OpenSSH_5.2


Using Fedora 11 kernel with its (+AFAIK upstream) defaults:
# cat /proc/version 
Linux version 2.6.30.5-43.fc11.x86_64
(mockbuild at xenbuilder4.fedora.phx.redhat.com) (gcc version 4.4.1
20090725 (Red Hat 4.4.1-2) (GCC) ) #1 SMP Thu Aug 27 21:39:52 EDT 2009
# cat /proc/sys/net/ipv6/bindv6only
0

In the current case one cannot access IPv6 because the IPv4 socket was
created first.  If IPv6 would be created first it would work.

The copy-pasted code could be probably moved to some unified function. 
This is out of scope of this patch.

Similiar problem+resolution was in Bug 164, Bug 1309 and Bug 1392.

-- 
Configure bugmail: https://bugzilla.mindrot.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.


More information about the openssh-bugs mailing list