Do not try to collect offset data if a prior offset correction is still
authorMatthew Dillon <dillon@dragonflybsd.org>
Tue, 26 Apr 2005 07:01:43 +0000 (07:01 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Tue, 26 Apr 2005 07:01:43 +0000 (07:01 +0000)
commitc32f1362b0dc104edefe459c9811095d2a7fad6d
tree720802a2491338069b904372eb09b04280a62f3e
parentb0984f74582a7ed16d76eb8d26455dca32742009
Do not try to collect offset data if a prior offset correction is still
in progress.  Since we do not compensate for the prior offset correction,
any corrections based on data accumulated while the prior correction is
active will overshoot or undershoot.

Offset calculations are based on compensated real time rather then
uncompensated real time, which is why this is a problem.  Frequency
corrections are based on uncompensated real time and do not have any
similar issue.  It would be even better, but more difficult, to adapt
the offset correction code to use uncompensated real time and then take
the compensation into account, but this is a considerably more complex
equation to get right.

There is still another problem and that is the offset error will continue
to build when the frequency is not corrected, potentially resulting in a
longer sync-up time.  On the positive side, the offset correction is based
on a standard deviation that only requires a minimum of 4 samples.

Correct a minor compiler warning.
usr.sbin/dntpd/client.c
usr.sbin/dntpd/client.h
usr.sbin/dntpd/defs.h
usr.sbin/dntpd/main.c
usr.sbin/dntpd/system.c