diff --git a/doc/chrony.conf.adoc b/doc/chrony.conf.adoc index 95693a2..d95949a 100644 --- a/doc/chrony.conf.adoc +++ b/doc/chrony.conf.adoc @@ -202,6 +202,9 @@ presend 9 when the polling interval is 512 seconds or more, an extra NTP client packet will be sent to the server a short time (4 seconds) before making the actual measurement. ++ +The *presend* option cannot be used in the *peer* directive or with the +*xleave* option. *minstratum* _stratum_::: When the synchronisation source is selected from available sources, sources with lower stratum are normally slightly preferred. This option can be used to diff --git a/ntp_core.c b/ntp_core.c index 066077a..5299f8f 100644 --- a/ntp_core.c +++ b/ntp_core.c @@ -498,7 +498,12 @@ NCR_GetInstance(NTP_Remote_Address *remote_addr, NTP_Source_Type type, SourcePar result->min_stratum = params->min_stratum; if (result->min_stratum >= NTP_MAX_STRATUM) result->min_stratum = NTP_MAX_STRATUM - 1; + + /* Presend doesn't work in symmetric and interleaved modes */ result->presend_minpoll = params->presend_minpoll; + if (result->presend_minpoll && + (result->mode != MODE_CLIENT || result->interleaved)) + result->presend_minpoll = 0; result->max_delay = params->max_delay; result->max_delay_ratio = params->max_delay_ratio;