From: Miroslav Lichvar Date: Wed, 15 Dec 2010 13:25:40 +0000 (+0100) Subject: Fix jitter test in source selection X-Git-Tag: 1.25-pre1~25 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=eec438a6146535e57bf80b7605f2cac08885f3c9;p=thirdparty%2Fchrony.git Fix jitter test in source selection Distance should be compared to square root of variance. --- diff --git a/sources.c b/sources.c index 3dcfc420..346eace7 100644 --- a/sources.c +++ b/sources.c @@ -622,7 +622,7 @@ SRC_SelectSource(unsigned long match_addr) variance */ for (i=0; isel_info.variance > min_distance) { + if (sqrt(sources[index]->sel_info.variance) > min_distance) { sel_sources[i] = INVALID_SOURCE; sources[index]->status = SRC_JITTERY; #if 0