mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 17:55:07 -05:00
ntp: fix adding noselect to selection options
If noselect is present in the configured options, don't assume it
cannot change and the effective options are equal. This fixes chronyc
selectopts +noselect command.
Fixes: 3877734814 ("sources: add function to modify selection options")
This commit is contained in:
23
sources.c
23
sources.c
@@ -587,18 +587,17 @@ update_sel_options(void)
|
||||
for (i = 0; i < n_sources; i++) {
|
||||
options = sources[i]->conf_sel_options;
|
||||
|
||||
if (options & SRC_SELECT_NOSELECT)
|
||||
continue;
|
||||
|
||||
switch (sources[i]->type) {
|
||||
case SRC_NTP:
|
||||
options |= sources[i]->authenticated ? auth_ntp_options : unauth_ntp_options;
|
||||
break;
|
||||
case SRC_REFCLOCK:
|
||||
options |= refclk_options;
|
||||
break;
|
||||
default:
|
||||
assert(0);
|
||||
if (!(options & SRC_SELECT_NOSELECT)) {
|
||||
switch (sources[i]->type) {
|
||||
case SRC_NTP:
|
||||
options |= sources[i]->authenticated ? auth_ntp_options : unauth_ntp_options;
|
||||
break;
|
||||
case SRC_REFCLOCK:
|
||||
options |= refclk_options;
|
||||
break;
|
||||
default:
|
||||
assert(0);
|
||||
}
|
||||
}
|
||||
|
||||
if (sources[i]->sel_options != options) {
|
||||
|
||||
Reference in New Issue
Block a user