DragonFly commits List (threaded) for 2005-04
cvs commit: src/usr.sbin/dntpd client.c client.h convert.c defs.h ntpreq.c
dillon 2005/04/24 02:39:27 PDT
DragonFly src repository
usr.sbin/dntpd client.c client.h convert.c defs.h
Change client_check() to calculate the best offset and the best frequency
The best offset correction now utilizes a standard deviation of the offset
error with a minimum of 4 samples. An offset correction occurs when the
standard deviation is less then 1/4 the average offset. When an offset
correction is made, the offset data is cleared (since it becomes invalid
once a correction is made). This calculation gives the code an almost
human perception of when the offset can be safely adjusted, regardless
of the 'mess' on the internet.
Change tv_delta_micro() into tv_delta_double() since most of the callers
were (previously) dividing the result by 1E6.
NOTE: the correllation for frequency correction is not working quite as
well as I had hoped, it's bouncing around a lot for internet ntp sources.
But the standard deviation on the offset appears to work very well.
Revision Changes Path
1.4 +147 -23 src/usr.sbin/dntpd/client.c
1.3 +22 -7 src/usr.sbin/dntpd/client.h
1.3 +3 -3 src/usr.sbin/dntpd/convert.c
1.3 +1 -1 src/usr.sbin/dntpd/defs.h
1.3 +1 -1 src/usr.sbin/dntpd/ntpreq.c