[Bug 1392] New: Systems with IPV6_V6ONLY = 0 have unexpected behavior

bugzilla-daemon at bugzilla.mindrot.org bugzilla-daemon at bugzilla.mindrot.org
Sat Nov 17 20:47:18 EST 2007


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

           Summary: Systems with IPV6_V6ONLY = 0 have unexpected behavior
    Classification: Unclassified
           Product: Portable OpenSSH
           Version: 4.7p1
          Platform: All
        OS/Version: Linux
            Status: NEW
          Severity: minor
          Priority: P2
         Component: sshd
        AssignedTo: bitbucket at mindrot.org
        ReportedBy: tsr2600 at gmail.com


Created an attachment (id=1382)
 --> (http://bugzilla.mindrot.org/attachment.cgi?id=1382)
turn on IPV6_V6ONLY in sshd before binding for systems that support it

I noticed that sshd on a Linux 2.6.23 system complains when it starts
up:

sshd[6292]: Server listening on :: port 22.
sshd[6292]: error: Bind to port 22 on 0.0.0.0 failed: Address already
in use.

>From what I understand, sshd is operating under the assumption that it
will not accept IPv4 connections on an IPv6 socket and vice versa
(e.g., -4 and -6 options that state that sshd will be forced to use
IPv[46] addresses only).

Currently, if I start sshd with the -6 flag, my expectation is that
sshd will only be able to accept connections over IPv6, but that is not
the case on Linux (v4-mapped addresses get used when a client connects
to an IPv6 socket over IPv4).

The attached patch turns on IPV6_V6ONLY if it is defined before binding
to a socket using AF_INET6. This resolves the bind error that sshd logs
on my system as well as giving users the (in my opinion) expected
behavior for the -6 command line option and Listen options in
sshd_config.

Patch has been tested on Linux 2.6.23, and it is against
openssh-SNAP-20071117

-- 
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