Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK4o1WzNrfteT=MYyZp=PKzj3DNv_DupSd5xW=2669J4Wnkweg@mail.gmail.com>
Date: Sat, 30 Nov 2013 17:43:11 +0000
From: Justin Cormack <justin@...cialbusservice.com>
To: musl@...ts.openwall.com
Subject: Re: IPv4 and IPv6 addresses in resolv.conf

On Sat, Nov 30, 2013 at 5:33 PM, Rob <robpilling@...il.com> wrote:
> Rich Felker, Sat, 30 Nov 2013:
>
>>>
>>> It is EAFNOSUPPORT if no kernel support at all.
>>>
>>> Actually I don't think there can be any cases where sending to the
>>> v4-mapped address (ie ::ffff:1.2.3.4) can fail where an ipv4 socket
>>> will succeed because those are basically ipv4 sockets with just ipv6
>>> notation, those addresses can't be routed by the ipv6 stack. So it
>>
>>
>> One thing I'm confused about is the addresses on the actual packets.
>> If we've already called bind for address :: and gotten assigned port
>> N, does this also reserve port N on 0.0.0.0, which will be needed when
>> sending from (and receiving back) IPv4 packets? Also, is there some
>> kernel option we might need to worry about that prevents :: from
>> receiving packets sent to IPv4 addresses, or does that only apply to
>> TCP, not UDP?
>
>
> I've been seeing this output consistently from mpd at startup:
>
>         listen: bind to '0.0.0.0:6600' failed: Address already in use
>         (continuing anyway, because binding to '[::]:6600' succeeded)
>
> mpd is the only program on my machine that binds to 6600 so it would
> appear that :: port bindings reserve the ipv4 port too. Could be a
> kernel configuration option though...
>

Yes the default is that ipv6 binds to both ipv6 and ipv4. There is a
sockopt IPV6_V6ONLY or /proc/sys/net/ipv6/bindv6only which defaults to
0.

I guess scheme above is going to fail if /proc/sys/net/ipv6/bindv6only
is set to 1, so the sockopt will have to be set manually as well to
force binding on both.

Justin

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.