sources: reset leap voting flag earlier in selection

Remove the leap vote from sources that get the noselect option, or
have too large distance or jitter.
This commit is contained in:
Miroslav Lichvar 2020-08-03 16:13:56 +02:00
parent 0e51552d2d
commit e5cf006378

View file

@ -793,6 +793,9 @@ SRC_SelectSource(SRC_Instance updated_inst)
for (i = 0; i < n_sources; i++) {
assert(sources[i]->status != SRC_OK);
/* Don't allow the source to vote on leap seconds unless it's selectable */
sources[i]->leap_vote = 0;
/* If some sources are specified with the require option, at least one
of them will have to be selectable in order to update the clock */
if (sources[i]->sel_options & SRC_SELECT_REQUIRE)
@ -842,7 +845,6 @@ SRC_SelectSource(SRC_Instance updated_inst)
}
sources[i]->status = SRC_OK; /* For now */
sources[i]->leap_vote = 0;
if (sources[i]->reachability && max_reach_sample_ago < first_sample_ago)
max_reach_sample_ago = first_sample_ago;