From: Miroslav Lichvar Date: Fri, 12 Aug 2011 12:49:23 +0000 (+0200) Subject: Limit skew used in NTP test4 X-Git-Tag: 1.27-pre1~47 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e0c9ed44f90940b24f1c18d70452ea0ee65960be;p=thirdparty%2Fchrony.git Limit skew used in NTP test4 With iburst and very jittery sources the source skew can reach very high values which makes the NTP test4 fail even with relatively small delays. Limit the skew to 2000 ppm to avoid getting state where a source is unable to accept more than first three iburst samples. --- diff --git a/sourcestats.c b/sourcestats.c index 257b6f5a..88e99114 100644 --- a/sourcestats.c +++ b/sourcestats.c @@ -528,6 +528,14 @@ SST_GetFrequencyRange(SST_Stats inst, skew = inst->skew; *lo = freq - skew; *hi = freq + skew; + + /* This function is currently used only to determine the values of delta + and epsilon in the ntp_core module. Limit the skew to a reasonable maximum + to avoid failing the dispersion test too easily. */ + if (skew > WORST_CASE_FREQ_BOUND) { + *lo = -WORST_CASE_FREQ_BOUND; + *hi = WORST_CASE_FREQ_BOUND; + } } /* ================================================== */