Recode the state machine to make it a bit less confusing. Collapse the
commit5bc413bf5c254e50e4dd7cf1c7750f1e8b3986fb
authorMatthew Dillon <dillon@dragonflybsd.org>
Mon, 25 Jun 2007 21:33:36 +0000 (25 21:33 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Mon, 25 Jun 2007 21:33:36 +0000 (25 21:33 +0000)
treec648f48526cd451fa9ad418492010a5e1527393d
parent853d8dce34671d4145b277c1b4ad67322bce6a8e
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