]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
Fix jitter test in source selection
authorMiroslav Lichvar <mlichvar@redhat.com>
Wed, 15 Dec 2010 13:25:40 +0000 (14:25 +0100)
committerMiroslav Lichvar <mlichvar@redhat.com>
Wed, 15 Dec 2010 13:25:40 +0000 (14:25 +0100)
Distance should be compared to square root of variance.

sources.c

index 3dcfc4207a7016ffb5c1d58b61a8ae4cf0769758..346eace78231149f8917c8ea4889959946e335a0 100644 (file)
--- a/sources.c
+++ b/sources.c
@@ -622,7 +622,7 @@ SRC_SelectSource(unsigned long match_addr)
          variance */
       for (i=0; i<n_sel_sources; i++) {
         index = sel_sources[i];
-        if (sources[index]->sel_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