mirror of
https://gitlab.com/chrony/chrony.git
synced 2026-01-21 05:10:19 -05:00
refclock: make maximum lock age configurable
The maxlockage option specifies in number of pulses how old can be samples from the refclock specified by the lock option to be paired with the pulses. Increasing this value is useful when the samples are produced at a lower rate than the pulses.
This commit is contained in:
6
conf.c
6
conf.c
@@ -674,6 +674,7 @@ static void
|
||||
parse_refclock(char *line)
|
||||
{
|
||||
int n, poll, dpoll, filter_length, pps_rate, min_samples, max_samples, sel_options;
|
||||
int max_lock_age;
|
||||
uint32_t ref_id, lock_ref_id;
|
||||
double offset, delay, precision, max_dispersion;
|
||||
char *p, *cmd, *name, *param;
|
||||
@@ -692,6 +693,7 @@ parse_refclock(char *line)
|
||||
precision = 0.0;
|
||||
max_dispersion = 0.0;
|
||||
ref_id = 0;
|
||||
max_lock_age = 2;
|
||||
lock_ref_id = 0;
|
||||
|
||||
if (!*line) {
|
||||
@@ -742,6 +744,9 @@ parse_refclock(char *line)
|
||||
} else if (!strcasecmp(cmd, "minsamples")) {
|
||||
if (sscanf(line, "%d%n", &min_samples, &n) != 1)
|
||||
break;
|
||||
} else if (!strcasecmp(cmd, "maxlockage")) {
|
||||
if (sscanf(line, "%d%n", &max_lock_age, &n) != 1)
|
||||
break;
|
||||
} else if (!strcasecmp(cmd, "maxsamples")) {
|
||||
if (sscanf(line, "%d%n", &max_samples, &n) != 1)
|
||||
break;
|
||||
@@ -795,6 +800,7 @@ parse_refclock(char *line)
|
||||
refclock->precision = precision;
|
||||
refclock->max_dispersion = max_dispersion;
|
||||
refclock->ref_id = ref_id;
|
||||
refclock->max_lock_age = max_lock_age;
|
||||
refclock->lock_ref_id = lock_ref_id;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user