aboutsummaryrefslogtreecommitdiff
path: root/networking/ntpd.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-01-01 21:59:49 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2010-01-01 21:59:49 +0100
commite4844b8a5fb0159281dbdbace333f69f6d3f1b4b (patch)
treee59d2cac663b28a83e9b3e87ece30662cc425876 /networking/ntpd.c
parent61313117a07fff81059376685dff3d61aaaf12b5 (diff)
downloadbusybox-w32-e4844b8a5fb0159281dbdbace333f69f6d3f1b4b.tar.gz
busybox-w32-e4844b8a5fb0159281dbdbace333f69f6d3f1b4b.tar.bz2
busybox-w32-e4844b8a5fb0159281dbdbace333f69f6d3f1b4b.zip
ntpd: add a comment, no code changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking/ntpd.c')
-rw-r--r--networking/ntpd.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/networking/ntpd.c b/networking/ntpd.c
index d4754f8ba..02761b3d4 100644
--- a/networking/ntpd.c
+++ b/networking/ntpd.c
@@ -432,7 +432,7 @@ filter_datapoints(peer_t *p, double t)
432 sum += dispersion(&p->filter_datapoint[idx], t) / (2 << i); 432 sum += dispersion(&p->filter_datapoint[idx], t) / (2 << i);
433 433
434 if (minoff == p->filter_datapoint[idx].d_offset) { 434 if (minoff == p->filter_datapoint[idx].d_offset) {
435 minoff -= 1; 435 minoff -= 1; /* so that we don't match it ever again */
436 } else 436 } else
437 if (maxoff == p->filter_datapoint[idx].d_offset) { 437 if (maxoff == p->filter_datapoint[idx].d_offset) {
438 maxoff += 1; 438 maxoff += 1;
@@ -447,6 +447,13 @@ filter_datapoints(peer_t *p, double t)
447 wavg += x; /* add another older6/64 to form older6/32 */ 447 wavg += x; /* add another older6/64 to form older6/32 */
448 p->filter_offset = wavg; 448 p->filter_offset = wavg;
449 p->filter_dispersion = sum; 449 p->filter_dispersion = sum;
450//TODO: fix systematic underestimation with large poll intervals.
451// Imagine that we still have a bit of uncorrected drift,
452// and poll interval is big. Offsets form a progression:
453// 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7, 0.7 is most recent.
454// The algorithm above drops 0.0 and 0.7 as outliers,
455// and then we have this estimation, ~25% off from 0.7:
456// 0.1/32 + 0.2/32 + 0.3/16 + 0.4/8 + 0.5/4 + 0.6/2 = 0.503125
450 457
451 // +----- -----+ ^ 1/2 458 // +----- -----+ ^ 1/2
452 // | n-1 | 459 // | n-1 |