[ntp:questions] Pool returns IPv6 address to IPv4 query
rick.jones2 at hp.com
Tue Nov 19 22:30:28 UTC 2013
Danny Mayer <mayer at ntp.org> wrote:
> On 11/19/2013 2:47 PM, Rick Jones wrote:
> > That passing-in a literal IPv6 address is precisely where I first
> > started noticing problems with netperf. For ages (in Internet
> > Time at least) it "just worked" even when all I had were
> > local-scope (link-scope?) IPv6 addresses configured. Then someone
> > made a libc change and life became Quite Unpleasant (tm).
> You should not be using literal IP addresses of either flavor
> without also setting the AI_NUMERICHOST flag otherwise it tries to
> do a DNS lookup. That's poorly written code otherwise.
I guess I was spoiled by gethostbyname()? I'll not contest whether
netperf contains poorly written code - it has plenty :) but I'll
point-out that looking at the Linux manpage for getaddrinfo() I get
the impression it is a suggestion rather than a requirement:
node specifies either a numerical network address (for IPv4,
numbers-and-dots notation as supported by inet_aton(3); for
IPv6, hexadecimal string format as supported by inet_pton(3)),
or a network hostname, whose network addresses are looked up
and resolved. If hints.ai_flags contains the AI_NUMERICHOST
flag then node must be a numerical network address. The
AI_NUMERICHOST flag suppresses any potentially lengthy network
host address lookups.
I parse that as "If AI_NUMEICHOST then must be addr" rather than "If
addr, must be AI_NUMERICHOST."
A: Because it fouls the order in which people normally read text.
Q: Why is top-posting such a bad thing?
Q: What is the most annoying thing on usenet and in e-mail?
More information about the questions