mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-05 12:35:07 -05:00
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:
2
client.c
2
client.c
@@ -1105,7 +1105,7 @@ process_cmd_add_server_or_peer(CMD_Request *msg, char *line)
|
||||
msg->data.ntp_source.asymmetry = UTI_FloatHostToNetwork(data.params.asymmetry);
|
||||
msg->data.ntp_source.offset = UTI_FloatHostToNetwork(data.params.offset);
|
||||
msg->data.ntp_source.flags = htonl(
|
||||
(data.params.online ? REQ_ADDSRC_ONLINE : 0) |
|
||||
(data.params.connectivity == SRC_ONLINE ? REQ_ADDSRC_ONLINE : 0) |
|
||||
(data.params.auto_offline ? REQ_ADDSRC_AUTOOFFLINE : 0) |
|
||||
(data.params.iburst ? REQ_ADDSRC_IBURST : 0) |
|
||||
(data.params.interleaved ? REQ_ADDSRC_INTERLEAVED : 0) |
|
||||
|
||||
Reference in New Issue
Block a user