From 220e6d19074be5ba838954745233a20c732c8ded Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Mon, 18 Jul 2022 12:43:13 +0200 Subject: [PATCH] ntp: fix initial poll to follow non-LAN minimum If a sub-second polling interval is configured, initialize the local poll to 0 to avoid a shorter interval between the first and second request in case no response to the first request is received (in time). --- ntp_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ntp_core.c b/ntp_core.c index 7a21f5e..cd8b627 100644 --- a/ntp_core.c +++ b/ntp_core.c @@ -650,7 +650,7 @@ NCR_CreateInstance(NTP_Remote_Address *remote_addr, NTP_Source_Type type, result->tx_timeout_id = 0; result->tx_suspended = 1; result->opmode = MD_OFFLINE; - result->local_poll = result->minpoll; + result->local_poll = MAX(result->minpoll, MIN_NONLAN_POLL); result->poll_score = 0.0; zero_local_timestamp(&result->local_tx); result->burst_good_samples_to_go = 0;