mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-06 17:55:06 -05:00
sources: add option to limit selection by root distance
Add maxdistance directive to set the maximum root distance the sources are allowed to have to be selected. This is useful to reject NTPv4 sources that are no longer synchronized and report large dispersion. The default value is 3 seconds.
This commit is contained in:
11
conf.c
11
conf.c
@@ -90,6 +90,7 @@ static double correction_time_ratio = 3.0;
|
||||
static double max_clock_error = 1.0; /* in ppm */
|
||||
static double max_slew_rate = 1e6 / 12.0; /* in ppm */
|
||||
|
||||
static double max_distance = 3.0;
|
||||
static double reselect_distance = 1e-4;
|
||||
static double stratum_weight = 1e-3;
|
||||
static double combine_limit = 3.0;
|
||||
@@ -477,6 +478,8 @@ CNF_ParseLine(const char *filename, int number, char *line)
|
||||
parse_maxchange(p);
|
||||
} else if (!strcasecmp(command, "maxclockerror")) {
|
||||
parse_double(p, &max_clock_error);
|
||||
} else if (!strcasecmp(command, "maxdistance")) {
|
||||
parse_double(p, &max_distance);
|
||||
} else if (!strcasecmp(command, "maxsamples")) {
|
||||
parse_int(p, &max_samples);
|
||||
} else if (!strcasecmp(command, "maxslewrate")) {
|
||||
@@ -1524,6 +1527,14 @@ CNF_GetMaxSlewRate(void)
|
||||
|
||||
/* ================================================== */
|
||||
|
||||
double
|
||||
CNF_GetMaxDistance(void)
|
||||
{
|
||||
return max_distance;
|
||||
}
|
||||
|
||||
/* ================================================== */
|
||||
|
||||
double
|
||||
CNF_GetReselectDistance(void)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user