mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 20:45:07 -05:00
ntp: enable sub-second poll sooner with filter option
When the minimum round-trip time is checked to enable a sub-second polling interval, consider also the last sample in the filter to avoid waiting for the first sample to be accumulated in sourcestats.
This commit is contained in:
@@ -783,6 +783,8 @@ NCR_ChangeRemoteAddress(NCR_Instance inst, NTP_Remote_Address *remote_addr, int
|
|||||||
static void
|
static void
|
||||||
adjust_poll(NCR_Instance inst, double adj)
|
adjust_poll(NCR_Instance inst, double adj)
|
||||||
{
|
{
|
||||||
|
NTP_Sample last_sample;
|
||||||
|
|
||||||
inst->poll_score += adj;
|
inst->poll_score += adj;
|
||||||
|
|
||||||
if (inst->poll_score >= 1.0) {
|
if (inst->poll_score >= 1.0) {
|
||||||
@@ -808,7 +810,9 @@ adjust_poll(NCR_Instance inst, double adj)
|
|||||||
or it is not in a local network according to the measured delay */
|
or it is not in a local network according to the measured delay */
|
||||||
if (inst->local_poll < MIN_NONLAN_POLL &&
|
if (inst->local_poll < MIN_NONLAN_POLL &&
|
||||||
(!SRC_IsReachable(inst->source) ||
|
(!SRC_IsReachable(inst->source) ||
|
||||||
SST_MinRoundTripDelay(SRC_GetSourcestats(inst->source)) > MAX_LAN_PEER_DELAY))
|
(SST_MinRoundTripDelay(SRC_GetSourcestats(inst->source)) > MAX_LAN_PEER_DELAY &&
|
||||||
|
(!inst->filter || !SPF_GetLastSample(inst->filter, &last_sample) ||
|
||||||
|
last_sample.peer_delay > MAX_LAN_PEER_DELAY))))
|
||||||
inst->local_poll = MIN_NONLAN_POLL;
|
inst->local_poll = MIN_NONLAN_POLL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user