Subject: Re: [Bugme-new] [Bug 15720] New: IPv6's ipv4-compatibility addresses don't bind

From: Brian Haley <[email-masked]>
Date: Tue, 13 Apr 2010 11:06:38 -0400

Andrew Morton wrote:
>> When attempting to bind to an address using ipv4-compatibility, for example,
>> "::ffff:127.0.0.1", Linux refuses to bind to that address when
>> /proc/sys/net/ipv6/bindv6only is set.

This is actually not a (deprecated) IPv4-compatible IPv6 address (::127.0.0.1),
but an IPv4-mapped IPv6 address.

>> It seems to me that the intent of "bindv6only" was to not bind to the ipv4
>> address when you bind to all addresses (specifically ipv6 address "::"). So
>> when you bind to ::, an ipv4 client connects to you, and it appears to be
>> connecting from ::ffff:192.168.5.5. I don't think its intent was to effectively
>> disable binding to ::ffff:x.x.x.x addresses - just breaking that feature makes
>> no sense.

It is documented in ip-sysctl.txt:

bindv6only - BOOLEAN
        Default value for IPV6_V6ONLY socket option,
        which restricts use of the IPv6 socket to IPv6 communication
        only.
                TRUE: disable IPv4-mapped address feature
                FALSE: enable IPv4-mapped address feature

        Default: FALSE (as specified in RFC2553bis)

-Brian