ntp: refactor switching between online and offline state

Use an enum to describe connectivity of a source and merge
the NCR and NSR TakeSourceOnline/Offline() functions into
SetConnectivity() functions.
This commit is contained in:
Miroslav Lichvar
2018-05-24 13:42:52 +02:00
parent 2962fc6286
commit ce6b896948
10 changed files with 78 additions and 113 deletions

2
conf.c
View File

@@ -1411,7 +1411,7 @@ CNF_AddInitSources(void)
ntp_addr.ip_addr = *(IPAddr *)ARR_GetElement(init_sources, i);
ntp_addr.port = cps_source.port;
cps_source.params.iburst = 1;
cps_source.params.online = 0;
cps_source.params.connectivity = SRC_OFFLINE;
NSR_AddSource(&ntp_addr, NTP_SERVER, &cps_source.params);
}