* Mouse <[email protected]>

> > Standard procedure is to use getaddrinfo(), iterate over the
> > results, try to bind or connect to each address (depending on
> > whether you're a server or a client) and ignore any failures as
> > long as at least one address works.
> 
> Yes.  In general, if it's not too inconvenient, I recommend doing
> multiple connect()s in parallel, so that, if v6 is supported and
> configured but does not actually have a working route to the target,
> v4 isn't delayed waiting for (possibly multiple) ETIMEDOUT.
> 
> However, in this case, we're talking about NTP, which runs over
> connectionless protocols anyway.  I'm not sure what I think the best
> action here is.  Initiate associations with all addresses, maybe?

Hm, from a very quick glance at the getaddrinfo() calls in the ntpd
directory of the source tree it seems none of them are passing in the
AI_ADDRCONFIG hint. That's the one that prevents getaddrinfo() from
returning "unusable" addresses (i.e., no IPv6 addresses if the node is
IPv4-only and vice versa).

Since ntpd's objective here is to find an address it can actually
communicate with it seems logical to use the AI_ADDRCONFIG hint.

Tore
_______________________________________________
pool mailing list
[email protected]
http://lists.ntp.org/listinfo/pool

Reply via email to