[ntp:questions] nptq -p slowness

Ronan Flood usenet at umbral.org.uk
Thu Feb 1 11:49:10 UTC 2007


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

-- 
Ronan Flood <usenet at umbral.org.uk>




More information about the questions mailing list