On 6/17/2011 7:44 PM, Rick Jones wrote: > John Hasler <[email protected]> wrote: >> Rick Jones wrote: >>> Netperf has been passing IPs to getaddrinfo() without setting any >>> special flags. > >> Chuck Swiger writes: >>> Maybe there are broken implementations of getaddrinfo() floating >>> around? > >> On Linux you must set a flag to tell it not to consider the possibility >> that what you are passing it is not a numeric address: > >> 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. > >> CONFORMING TO >> POSIX.1-2001. The getaddrinfo() function is documented in RFC 2553. > > I may be parsing your sentence incorrectly, but my reading of the > manpage is that one may set AI_NUMERICHOST, in which case node must be > an IP address, but that is not the same thing as saying that if node > is an IP address that AI_NUMERICHOST must be set.
I think you are misreading it. As I recall, if you don't provide it with hints, it defaults and does a lookup on the string provided. You have to set the AI_NUMERICHOST to prevent that. Can you look at HP's source code for getaddrinfo() on various platforms and see what it does? I did look at this in considerable detail at the time that I was working on this one. I don't however remember a lot of the details. Danny _______________________________________________ questions mailing list [email protected] http://lists.ntp.org/listinfo/questions
