mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-05 13:35:07 -05:00
ntp: support pools
The pool directive can be used to configure chronyd for a pool of NTP servers (e.g. pool.ntp.org). The name is expected to resolve to multiple addresses which change over time. On start, a source will be added for each resolved address. When a source from the pool is unreachable or marked as falseticker, chronyd will try to replace the source with a newly resolved address of the pool. The minimum interval between replacements is currently set to 244 seconds to avoid frequent DNS requests.
This commit is contained in:
@@ -36,6 +36,7 @@
|
||||
#include "sourcestats.h"
|
||||
#include "memory.h"
|
||||
#include "ntp.h" /* For NTP_Leap */
|
||||
#include "ntp_sources.h"
|
||||
#include "local.h"
|
||||
#include "reference.h"
|
||||
#include "util.h"
|
||||
@@ -399,6 +400,12 @@ SRC_UpdateReachability(SRC_Instance inst, int reachable)
|
||||
if (REF_GetMode() != REF_ModeNormal && special_mode_end()) {
|
||||
REF_SetUnsynchronised();
|
||||
}
|
||||
|
||||
/* Try to replace NTP sources that are unreachable or falsetickers */
|
||||
if (inst->type == SRC_NTP && (inst->status == SRC_FALSETICKER ||
|
||||
(!inst->reachability && inst->reachability_size == SOURCE_REACH_BITS))) {
|
||||
NSR_HandleBadSource(inst->ip_addr);
|
||||
}
|
||||
}
|
||||
|
||||
/* ================================================== */
|
||||
|
||||
Reference in New Issue
Block a user