]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
ntp: disable maxdelayratio in interleaved/symmetric mode
authorMiroslav Lichvar <mlichvar@redhat.com>
Mon, 12 Dec 2016 08:11:49 +0000 (09:11 +0100)
committerMiroslav Lichvar <mlichvar@redhat.com>
Tue, 13 Dec 2016 11:57:24 +0000 (12:57 +0100)
It's too unreliable and the maxdelaydevratio test should work better
anyway.

doc/chrony.conf.adoc
ntp_core.c

index 6e9ab909e8c1052fa625763cd1ba6282e6528bb7..88f6b94221adb677be0bbdc519ba8274fc5ac185 100644 (file)
@@ -110,7 +110,8 @@ round-trip delay of 0.3 seconds or more should be ignored. The default value is
 This option is similar to the maxdelay option above. *chronyd* keeps a record
 of the minimum round-trip delay amongst the previous measurements that it has
 buffered. If a measurement has a round trip delay that is greater than the
-maxdelayratio times the minimum delay, it will be rejected.
+maxdelayratio times the minimum delay, it will be rejected. This option works
+only in the *server* directive when not in the interleaved mode.
 *maxdelaydevratio* _ratio_:::
 If a measurement has a ratio of the increase in the round-trip delay from the
 minimum delay amongst the previous measurements to the standard deviation of
index 9695bd66ff9ee924e738cca91e655d7c5656c330..00aee3f58d4875990f1826d3215ec1e45776488d 100644 (file)
@@ -1453,11 +1453,12 @@ receive_packet(NCR_Instance inst, NTP_Local_Address *local_addr,
             !(inst->mode == MODE_ACTIVE && interleaved_packet &&
               delay > UTI_Log2ToDouble(message->poll - 1));
 
-    /* Test B requires that the ratio of the round trip delay to the
-       minimum one currently in the stats data register is less than an
-       administrator-defined value */
+    /* Test B requires in the basic client mode that the ratio of the round
+       trip delay to the minimum one currently in the stats data register is
+       less than an administrator-defined value */
     testB = inst->max_delay_ratio <= 1.0 ||
-            (delay - dispersion) / SST_MinRoundTripDelay(stats) <= inst->max_delay_ratio;
+            !(inst->mode == MODE_CLIENT && !interleaved_packet &&
+              (delay - dispersion) / SST_MinRoundTripDelay(stats) > inst->max_delay_ratio);
 
     /* Test C requires that the ratio of the increase in delay from the minimum
        one in the stats data register to the standard deviation of the offsets