This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

getaddrinfo and AF_UNSPEC w/ IPv4/6 messes up ai_canonname?


Hello,

I noticed something strange when using getaddrinfo to get both IPv4 and 
IPv6 addresses w/ AI_CANONNAME.

I wrote (or parsed together) a small, attached test program to demonstrate 
this.

On Linux I get like:

pekkas: /home/pekkas$ ./test-canonname
host: ftp.kame.net, canon (if any): 3ffe:501:4819:2000:210:f3ff:fe03:4d0
pekkas: /home/pekkas$ ./test-canonname
host: ftp.kame.net, canon (if any): 2001:200:0:4819:210:f3ff:fe03:4d0

On e.g. FreeBSD I get like:

$ ./test-canonname
host: ftp.kame.net, canon (if any): kame220.kame.net

2001:200:0:4819:210:f3ff:fe03:4d0 or 3ffe:501:4819:2000:210:f3ff:fe03:4d 
are _not_ canonical names, so it looks like a bug.

Thanks,

-- 
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

Attachment: test-canonname.c
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]