From: "Clément Vasseur" <clement.vasseur@gmail.com>
To: musl@lists.openwall.com
Subject: getaddrinfo behaviour with AI_V4MAPPED
Date: Tue, 11 Feb 2014 16:35:30 +0000 (UTC) [thread overview]
Message-ID: <lddjgi$jv9$1@ger.gmane.org> (raw)
Hi,
I noticed a difference between musl and glibc for the following code:
struct addrinfo hints;
struct addrinfo *res;
memset(&hints, 0, sizeof hints);
hints.ai_family = AF_INET6;
hints.ai_flags = AI_NUMERICHOST | AI_V4MAPPED | AI_ALL;
ret = getaddrinfo("192.168.0.1", NULL, &hints, &res);
musl returns EAI_NONAME (Name does not resolve)
glibc returns the correct ipv6 address in ipv4-mapped format.
The POSIX specification for AI_V4MAPPED says:
If the AI_V4MAPPED flag is specified along with an ai_family of
AF_INET6, then getaddrinfo() shall return IPv4-mapped IPv6 addresses
on finding no matching IPv6 addresses ( ai_addrlen shall be 16). The
AI_V4MAPPED flag shall be ignored unless ai_family equals AF_INET6.
If the AI_ALL flag is used with the AI_V4MAPPED flag, then
getaddrinfo() shall return all matching IPv6 and IPv4 addresses. The
AI_ALL flag without the AI_V4MAPPED flag is ignored. [Option End]
Shouldn't musl behave like glibc in this example?
reply other threads:[~2014-02-11 16:35 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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='lddjgi$jv9$1@ger.gmane.org' \
--to=clement.vasseur@gmail.com \
--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).