Bug#683061: [pkg-ntp-maintainers] Bug#683061: bug report #683061

2013-07-02 Thread Kurt Roeckx
On Sun, Jun 30, 2013 at 10:53:16PM +0200, Thomas Hood wrote:
 getaddrinfo() returns -11 with errno 2 (EAI_SYSTEM with errno ENOENT)
 both when no nameserver can be reached and when the domain name does not
 exist. So if you want to behave differently in these two cases you can't do
 so based solely on the returned status of getaddrinfo().
 
 Hypothesis: ntpd handles -11/2 as meaning NXDOMAIN and treats this as a
 permanent error whereas -11/2 could also mean that no nameservers could be
 reached which should not be treated as a permanent error.
 
 What I would suggest is that both no-nameservers-are-reachable and NXDOMAIN
 be treated as non-permanent errors. That a domain name does not now exist
 does not entail that it never will exist. And then there is no need to
 distinguish the two cases.

Do you know NXDOMAIN returns?  I think it returns just the same?

So ntpd should just keep trying to resolv invalid hostnames?


Kurt


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#683061: [pkg-ntp-maintainers] Bug#683061: bug report #683061

2013-07-02 Thread Thomas Hood
On Tue, Jul 2, 2013 at 1:59 PM, Kurt Roeckx k...@roeckx.be wrote:

 Do you know NXDOMAIN returns?  I think it returns just the same?



I don't immediately see how getaddrinfo() alone can be used to tell
whether or not an actual NXDOMAIN was received. A test with a small
C program reveals that retval -11 errno 2 is returned both in the
NXDOMAIN case and in the case where no nameservers could be found.




 So ntpd should just keep trying to resolv invalid hostnames?



That may seem like a waste of resources, but

* Computers are mobile these days and DNS also changes from the
perspective of those computers. A laptop may connect sometimes
to a LAN where the domain name ntp.somecorp.private resolves to
the address of a time server.  On other LANs this name does not exist.

* If the retry period is on the order of seconds then the resources
used aren't very significant.

* If the name of the time server never resolves and this is a problem
then it's the admin's fault for failing to configure ntpd properly.

I suppose the question really is, when should the admin be
notified that there is a problem?  Good question.  Is there something
wrong with ntpd just logging resolution failures and leaving it at that?

Anyway, you be the judge.

Best wishes,
-- 
Thomas