sources: try to replace NTP sources with bad distance

Similarly to unreachable sources and falsetickers, try to replace
sources with distance larger than the limit set by the maxdistance
directive with a newly resolved address of the hostname.
This commit is contained in:
Miroslav Lichvar 2016-03-22 17:01:38 +01:00
parent eb329e9f52
commit d70e815e9f
2 changed files with 10 additions and 7 deletions

View file

@ -204,10 +204,11 @@ the default value is 4.
+ +
On start, when the pool name is resolved, *chronyd* will add up to 16 sources, On start, when the pool name is resolved, *chronyd* will add up to 16 sources,
one for each resolved address. When the number of sources from which at least one for each resolved address. When the number of sources from which at least
one valid reply was received reaches *maxsources*, the other sources will be one valid reply was received reaches the number specified by the *maxsources*
removed. When a pool source is unreachable or marked as a falseticker, option, the other sources will be removed. When a pool source is unreachable,
*chronyd* will try to replace the source with a newly resolved address of the marked as a falseticker, or has a distance larger than the limit set by the
pool. <<maxdistance,*maxdistance*>> directive, *chronyd* will try to replace the
source with a newly resolved address from the pool.
+ +
An example of the *pool* directive is An example of the *pool* directive is
+ +

View file

@ -429,9 +429,11 @@ SRC_UpdateReachability(SRC_Instance inst, int reachable)
REF_SetUnsynchronised(); REF_SetUnsynchronised();
} }
/* Try to replace NTP sources that are unreachable or falsetickers */ /* Try to replace NTP sources that are unreachable, falsetickers, or
if (inst->type == SRC_NTP && (inst->status == SRC_FALSETICKER || have root distance larger than the allowed maximum */
(!inst->reachability && inst->reachability_size == SOURCE_REACH_BITS))) { if (inst->type == SRC_NTP &&
((!inst->reachability && inst->reachability_size == SOURCE_REACH_BITS) ||
inst->status == SRC_FALSETICKER || inst->status == SRC_BAD_DISTANCE)) {
NSR_HandleBadSource(inst->ip_addr); NSR_HandleBadSource(inst->ip_addr);
} }
} }