sources: keep synchronized status with unreachable/unselectable sources
Following RFC 5905, don't call REF_SetUnsynchronised() when there are no reachable or selectable sources. It's up to the client to consider the source unsynchronized when the root distance exceeds a threshold. The unsynchronized status is still set when no majority is reached.
This commit is contained in:
parent
e930d94728
commit
049eae661a
1 changed files with 2 additions and 8 deletions
10
sources.c
10
sources.c
|
@ -571,7 +571,7 @@ combine_sources(int n_sel_sources, struct timeval *ref_time, double *offset,
|
|||
void
|
||||
SRC_SelectSource(SRC_Instance updated_inst)
|
||||
{
|
||||
int i, j, index, old_selected_index, sel_prefer;
|
||||
int i, j, index, sel_prefer;
|
||||
struct timeval now, ref_time;
|
||||
double src_offset, src_offset_sd, src_frequency, src_skew;
|
||||
double src_root_delay, src_root_dispersion;
|
||||
|
@ -588,7 +588,6 @@ SRC_SelectSource(SRC_Instance updated_inst)
|
|||
double max_score;
|
||||
|
||||
NTP_Leap leap_status = LEAP_Normal;
|
||||
old_selected_index = selected_source_index;
|
||||
|
||||
if (updated_inst)
|
||||
updated_inst->updates++;
|
||||
|
@ -598,7 +597,6 @@ SRC_SelectSource(SRC_Instance updated_inst)
|
|||
if (selected_source_index != INVALID_SOURCE) {
|
||||
log_selection_message("Can't synchronise: no sources", NULL);
|
||||
selected_source_index = INVALID_SOURCE;
|
||||
REF_SetUnsynchronised();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
@ -748,6 +746,7 @@ SRC_SelectSource(SRC_Instance updated_inst)
|
|||
|
||||
if (selected_source_index != INVALID_SOURCE) {
|
||||
log_selection_message("Can't synchronise: no majority", NULL);
|
||||
REF_SetUnsynchronised();
|
||||
}
|
||||
selected_source_index = INVALID_SOURCE;
|
||||
|
||||
|
@ -990,11 +989,6 @@ SRC_SelectSource(SRC_Instance updated_inst)
|
|||
}
|
||||
selected_source_index = INVALID_SOURCE;
|
||||
}
|
||||
|
||||
if (selected_source_index == INVALID_SOURCE &&
|
||||
selected_source_index != old_selected_index) {
|
||||
REF_SetUnsynchronised();
|
||||
}
|
||||
}
|
||||
|
||||
/* ================================================== */
|
||||
|
|
Loading…
Reference in a new issue