Recode the state machine to make it a bit less confusing. Collapse the
authorMatthew Dillon <dillon@dragonflybsd.org>
Mon, 25 Jun 2007 21:33:36 +0000 (21:33 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Mon, 25 Jun 2007 21:33:36 +0000 (21:33 +0000)
commit2408d859638c44786c83cc40b93c1da8b7d3feaa
treee3438ad8fc5d4f025e0f5341c95b61b4b283a1e9
parent47db7f9b458e3e3dd9fe2dde958f9dbd85d54318
Recode the state machine to make it a bit less confusing.  Collapse the
two failure states into a single failure state and handle failure processing
in each state.

Handle DNS failures by having dntpd relookup failed DNSes occassionally.

dntpd will now relookup the server name if a server fails, allowing you
to specify domains which front pools of ntp servers.  dntpd will also
check for duplicate IPs and relookup again (up to a point).

Add a sanity check.  If two or more servers are specified a quorum of
servers must agree that the selected time offset is reasonable.  For the
moment do a +/- 30 second check (though we can probably make this +/- 2
seconds).   If a server is determined to be broken, scrap its data and
reconnect.  If it is still broken, permanently disable it.  This is
primarily to handle severely broken servers that are occassionally present
in ntp pools.
usr.sbin/dntpd/client.c
usr.sbin/dntpd/client.h
usr.sbin/dntpd/defs.h
usr.sbin/dntpd/log.c
usr.sbin/dntpd/main.c
usr.sbin/dntpd/socket.c