[ntp:questions] nptq -p slowness
Danny Mayer
mayer at ntp.isc.org
Sat Feb 3 05:34:14 UTC 2007
Ronan Flood wrote:
> Serge Bets <serge.bets at NOSPAM.laposte.invalid> wrote:
>
>> It seems you are right on the track: My system has no getaddrinfo(). So
>> ntpq 4.2.4 uses its own bundled replacement from libntp/ntp_rfc2553.c,
>> which doesn't seem to make use of AI_NUMERICHOST.
>
> Ah, I hadn't spotted that: that is a bug in the ntpq code.
> I think it can be fixed in ntp_rfc2553.c/do_nodename(),
> something along these lines:
>
> --- ntp_rfc2553.c.orig Thu Dec 28 12:03:08 2006
> +++ ntp_rfc2553.c Thu Feb 1 11:40:40 2007
> @@ -397,6 +397,9 @@
> * Look for a name
> */
>
> + if (hints && (hints->ai_flags & AI_NUMERICHOST))
> + return (EAI_NONAME);
> +
> errval = DNSlookup_name(nodename, AF_INET, &hp);
>
> if (hp == NULL) {
>
>
> There are probably more elegant alternatives ...
>
This does indeed fix a problem in that code. It's not heavily exercised
since most systems are now running newer O/S's which have the
getaddrinfo() function in their libraries. I will get this into the next
release.
Thanks,
Danny
More information about the questions
mailing list