This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: getaddrinfo and AF_UNSPEC w/ IPv4/6 messes up ai_canonname?
- From: Ulrich Drepper <drepper at redhat dot com>
- To: Pekka Savola <pekkas at netcore dot fi>
- Cc: libc-alpha at sources dot redhat dot com
- Date: Sat, 24 Aug 2002 00:56:40 -0700
- Subject: Re: getaddrinfo and AF_UNSPEC w/ IPv4/6 messes up ai_canonname?
- References: <Pine.LNX.4.44.0208130924470.27193-200000@netcore.fi>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Pekka Savola wrote:
I noticed something strange when using getaddrinfo to get both IPv4 and
IPv6 addresses w/ AI_CANONNAME.
Your example code fails to iterate over all results. This is what I get
if I modify the output part of your code to iterate via ai_next:
host: ftp.kame.net, canon (if any): 2001:200:0:4819:210:f3ff:fe03:4d0
host: ftp.kame.net, canon (if any): 3ffe:501:4819:2000:210:f3ff:fe03:4d0
host: ftp.kame.net, canon (if any): kame220.kame.net
Now you see that indeed the right canonical name is generated. Why
should the implementation not return the IPv6 entries? This is what
your report seems to imply. One could argue that returning the numeric
format should never happen. But where is this written? It's easy
enough to implement but I am not willing to make a change unless you can
motivate it.
- --
- ---------------. ,-. 1325 Chesapeake Terrace
Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA
Red Hat `--' drepper at redhat.com `------------------------
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQE9Zzw82ijCOnn/RHQRAhcYAJoCQ8/YbC7p0wObIYbSP2AngWbNwwCZAXrn
efV1jc+MOc+AgP/UH1UdGRs=
=GdVw
-----END PGP SIGNATURE-----