From e1645966ec926e9ac9840f9b31d407d5cccf571a Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Tue, 1 Aug 2017 10:01:53 +0200 Subject: [PATCH] ntp: enable maxdelayratio test in interleaved client mode With more accurate delay in interleaved mode the test should now be as reliable as in basic mode. --- doc/chrony.conf.adoc | 4 ++-- ntp_core.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/chrony.conf.adoc b/doc/chrony.conf.adoc index 3607c83..62f86fc 100644 --- a/doc/chrony.conf.adoc +++ b/doc/chrony.conf.adoc @@ -115,8 +115,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. This option works -only in the *server* directive when not in the interleaved mode. +maxdelayratio times the minimum delay, it will be rejected. This option does +not work in the *peer* directive. *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 diff --git a/ntp_core.c b/ntp_core.c index 4c3e9b6..2a62537 100644 --- a/ntp_core.c +++ b/ntp_core.c @@ -1506,11 +1506,11 @@ 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 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 */ + /* Test B requires in 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 || - !(inst->mode == MODE_CLIENT && !interleaved_packet && + !(inst->mode == MODE_CLIENT && (delay - dispersion) / SST_MinRoundTripDelay(stats) > inst->max_delay_ratio); /* Test C requires that the ratio of the increase in delay from the minimum