ntp: rework initial burst

Instead of making the initial burst only once and immediately after
chronyd start (even when iburst is specified together with the offline
option), trigger the burst whenever the connectivity changes from
offline to online.
This commit is contained in:
Miroslav Lichvar
2020-06-23 13:10:02 +02:00
parent 8882fb21e0
commit b0fe443632
4 changed files with 37 additions and 25 deletions

3
conf.c
View File

@@ -1771,11 +1771,10 @@ CNF_AddInitSources(void)
/* Get the default NTP params */
CPS_ParseNTPSourceAdd(dummy_hostname, &cps_source);
/* Add the address as an offline iburst server */
/* Add the address as a server specified with the iburst option */
ntp_addr.ip_addr = *(IPAddr *)ARR_GetElement(init_sources, i);
ntp_addr.port = cps_source.port;
cps_source.params.iburst = 1;
cps_source.params.connectivity = SRC_OFFLINE;
NSR_AddSource(&ntp_addr, NTP_SERVER, &cps_source.params, NULL);
}