From: Miroslav Lichvar Date: Thu, 10 Apr 2014 15:11:20 +0000 (+0200) Subject: sources: ignore inactive sources in special mode ending X-Git-Tag: 1.30-pre1~76 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7fa22d4c25baebfd3a65ae654424a1abe1f80ed5;p=thirdparty%2Fchrony.git sources: ignore inactive sources in special mode ending --- diff --git a/main.c b/main.c index e8daf33d..dec753de 100644 --- a/main.c +++ b/main.c @@ -150,8 +150,8 @@ post_init_ntp_hook(void *anything) RCL_StartRefclocks(); /* Special modes can end only when sources update their reachability. - Give up immediatelly if there are no sources. */ - if (ref_mode != REF_ModeNormal && !SRC_ReadNumberOfSources()) { + Give up immediatelly if there are no active sources. */ + if (ref_mode != REF_ModeNormal && !SRC_ActiveSources()) { REF_SetUnsynchronised(); } } diff --git a/sources.c b/sources.c index 8ba1190a..8eae88b8 100644 --- a/sources.c +++ b/sources.c @@ -373,6 +373,10 @@ special_mode_end(void) int i; for (i = 0; i < n_sources; i++) { + /* No updates from inactive sources */ + if (!sources[i]->active) + continue; + /* Don't expect more updates than from an offline iburst NTP source */ if (sources[i]->reachability_size >= SOURCE_REACH_BITS - 1) continue;