summaryrefslogtreecommitdiff
path: root/networking/ntpd.c
diff options
context:
space:
mode:
authorDenys Vlasenko2010-01-01 21:59:49 +0100
committerDenys Vlasenko2010-01-01 21:59:49 +0100
commite4844b8a5fb0159281dbdbace333f69f6d3f1b4b (patch)
treee59d2cac663b28a83e9b3e87ece30662cc425876 /networking/ntpd.c
parent61313117a07fff81059376685dff3d61aaaf12b5 (diff)
downloadbusybox-e4844b8a5fb0159281dbdbace333f69f6d3f1b4b.zip
busybox-e4844b8a5fb0159281dbdbace333f69f6d3f1b4b.tar.gz
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 d4754f8..02761b3 100644
--- a/networking/ntpd.c
+++ b/networking/ntpd.c
@@ -432,7 +432,7 @@ filter_datapoints(peer_t *p, double t)
sum += dispersion(&p->filter_datapoint[idx], t) / (2 << i);
if (minoff == p->filter_datapoint[idx].d_offset) {
- minoff -= 1;
+ minoff -= 1; /* so that we don't match it ever again */
} else
if (maxoff == p->filter_datapoint[idx].d_offset) {
maxoff += 1;
@@ -447,6 +447,13 @@ filter_datapoints(peer_t *p, double t)
wavg += x; /* add another older6/64 to form older6/32 */
p->filter_offset = wavg;
p->filter_dispersion = sum;
+//TODO: fix systematic underestimation with large poll intervals.
+// Imagine that we still have a bit of uncorrected drift,
+// and poll interval is big. Offsets form a progression:
+// 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7, 0.7 is most recent.
+// The algorithm above drops 0.0 and 0.7 as outliers,
+// and then we have this estimation, ~25% off from 0.7:
+// 0.1/32 + 0.2/32 + 0.3/16 + 0.4/8 + 0.5/4 + 0.6/2 = 0.503125
// +----- -----+ ^ 1/2
// | n-1 |