tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

getaddrinfo(3) on numerical addresses

I've noticed[*] that on NetBSD, getaddrinfo(3) does a resolver lookup even 
if presented a numerical address. Is this on purpose? Would it have a 
drawback if it would first try to inet_pton() the address?
On Linux, it seems to avoid the resolver lookup.

* The problem was net/nagios-plugins' check_ping to stall during a resolver 
malfunction (despite the addresses given numerically). It turned out that 
check_ping, in order to find out whether it needs to call a syntactically 
different ping6 command, checks whether the -H argument is IPv6. It does 
this eventually by calling getaddrinfo() with an AF_INET6 hint, resulting 
in resolver lookups, which failed.

Home | Main Index | Thread Index | Old Index