From: Rich Felker <dalias@libc.org>
To: musl@lists.openwall.com
Subject: Re: [musl] getaddrinfo(3) with AI_V4MAPPED and AI_ALL flags
Date: Thu, 27 Feb 2020 09:45:23 -0500 [thread overview]
Message-ID: <20200227144523.GE11469@brightrain.aerifal.cx> (raw)
In-Reply-To: <89b25567-5887-80ee-bfac-58b25e7a9b45@bell-sw.com>
On Thu, Feb 27, 2020 at 01:17:20PM +0300, Alexander Scherbatiy wrote:
> Hello,
>
> When I call getaddrinfo() with different families, SOCK_STREAM
> socktype, IPPROTO_TCP protocol, and AI_PASSIVE flag the result is
> the same on the Alpine Linux 3.11.3 and Ubuntu 19.10 (the code
> sample is below):
>
> ----------------
>
> family: AF_UNSPEC, flags: AI_PASSIVE
> AF_INET IPv4 addr '0.0.0.0'
> AF_INET6 IPv6 addr '::'
>
> family: AF_INET, flags: AI_PASSIVE
> AF_INET IPv4 addr '0.0.0.0'
>
> family: AF_INET6, flags: AI_PASSIVE
> AF_INET6 IPv6 addr '::'
>
> ----------------
>
> When I use getaddrinfo() with AF_INET6 family and additional
> AI_V4MAPPED | AI_ALL (return both IPv6 and IPv4-mapped IPv6
> addresses) flags the result on Ubuntu contains only IPv6 '::'
> address:
>
> ----------------
>
> family: AF_INET6, flags: AI_PASSIVE | AI_V4MAPPED | AI_ALL
> AF_INET6 IPv6 addr '::'
>
> ----------------
>
> whereas the result on Alpine Linux contains both IPv4-mapped IPv6
> addresses '::ffff:0.0.0.0' and IPv6 '::'
>
> ----------------
>
> family: AF_INET6, flags: AI_PASSIVE | AI_V4MAPPED | AI_ALL
> AF_INET6 IPv6 addr '::ffff:0.0.0.0'
> AF_INET6 IPv6 addr '::'
>
> ----------------
>
> Is it expected behavior?
>
> I use Alpine Linux 3.11.3 from docker with musl libc (x86_64).
The musl behavior is as intended and I think it's more correct. If
net.ipv6.bindv6only sysctl is enabled, binding using the glibc results
would fail to accept ipv4 connections.
Rich
next prev parent reply other threads:[~2020-02-27 14:45 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-27 10:17 Alexander Scherbatiy
2020-02-27 14:45 ` Rich Felker [this message]
2020-07-30 15:20 ` Alexander Scherbatiy
2020-07-30 16:00 ` Rich Felker
2020-07-31 16:21 ` Dmitry Samersoff
2020-07-31 19:19 ` Rich Felker
2020-08-03 8:15 ` Dmitry Samersoff
2020-08-03 13:37 ` Rich Felker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200227144523.GE11469@brightrain.aerifal.cx \
--to=dalias@libc.org \
--cc=musl@lists.openwall.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).