ntp: limit number of pool sources

A new option can be now used in the pool directive: maxsources sets the
maximum number of sources that can be used from the pool, the default
value is 4.

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 valid reply was received reaches maxsources, the
other sources will be removed.
This commit is contained in:
Miroslav Lichvar
2014-11-26 16:40:33 +01:00
parent f2c80cae44
commit 308bcae257
7 changed files with 93 additions and 10 deletions

View File

@@ -39,6 +39,7 @@ typedef struct {
int min_stratum;
int poll_target;
int version;
int max_sources;
uint32_t authkey;
double max_delay;
double max_delay_ratio;
@@ -55,6 +56,7 @@ typedef struct {
#define SRC_DEFAULT_MAXDELAYDEVRATIO 10.0
#define SRC_DEFAULT_MINSTRATUM 0
#define SRC_DEFAULT_POLLTARGET 6
#define SRC_DEFAULT_MAXSOURCES 4
#define INACTIVE_AUTHKEY 0
#endif /* GOT_SRCPARAMS_H */