From: Miroslav Lichvar Date: Thu, 14 Mar 2024 14:37:15 +0000 (+0100) Subject: ntp: avoid unnecessary restart of resolving round on refresh X-Git-Tag: 4.6-pre1~34 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=863866354d058554e691959870770a8a07350431;p=thirdparty%2Fchrony.git ntp: avoid unnecessary restart of resolving round on refresh Don't call NSR_ResolveSources() when a resolving round is already started. This cuts the number of calls of the system resolver made due to the refresh command to half. --- diff --git a/ntp_sources.c b/ntp_sources.c index 1257f577..64d9a8b4 100644 --- a/ntp_sources.c +++ b/ntp_sources.c @@ -1056,7 +1056,10 @@ resolve_source_replacement(SourceRecord *record, int refreshment) us->address = *record->remote_addr; append_unresolved_source(us); - NSR_ResolveSources(); + + /* Don't restart resolving round if already running */ + if (!resolving_source) + NSR_ResolveSources(); } /* ================================================== */