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: Pekka Savola <pekkas at netcore dot fi>
- To: Ulrich Drepper <drepper at redhat dot com>
- Cc: libc-alpha at sources dot redhat dot com
- Date: Sun, 25 Aug 2002 23:13:50 +0300 (EEST)
- Subject: Re: getaddrinfo and AF_UNSPEC w/ IPv4/6 messes up ai_canonname?
On Sat, 24 Aug 2002, Ulrich Drepper wrote:
> -----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.
Ok.
> 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.
Exactly.
> 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.
Well,
1) with PF_INET, this does not happen (CNAME entry is returned, not
addresses -- at least as far as I could see): thus the current behaviour
does not seem the same between address families.
2) (not really motivation, but still..) e.g. BSD libc does not return
addresses (the test works as "expected"); I haven't checked other
implementations.
Is this enough motivation?
--
Pekka Savola "Tell me of difficulties surmounted,
Netcore Oy not those you stumble over and fall"
Systems. Networks. Security. -- Robert Jordan: A Crown of Swords