mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 19:35:06 -05:00
Add flags field to chronyc add source request
This will allow adding new flags without breaking compatibility.
This commit is contained in:
7
cmdmon.c
7
cmdmon.c
@@ -1228,8 +1228,8 @@ handle_add_server(CMD_Request *rx_message, CMD_Reply *tx_message)
|
||||
params.maxpoll = ntohl(rx_message->data.ntp_source.maxpoll);
|
||||
params.presend_minpoll = ntohl(rx_message->data.ntp_source.presend_minpoll);
|
||||
params.authkey = ntohl(rx_message->data.ntp_source.authkey);
|
||||
params.online = ntohl(rx_message->data.ntp_source.online);
|
||||
params.auto_offline = ntohl(rx_message->data.ntp_source.auto_offline);
|
||||
params.online = ntohl(rx_message->data.ntp_source.flags) & REQ_ADDSRC_ONLINE ? 1 : 0;
|
||||
params.auto_offline = ntohl(rx_message->data.ntp_source.flags) & REQ_ADDSRC_AUTOOFFLINE ? 1 : 0;
|
||||
params.max_delay = WIRE2REAL(rx_message->data.ntp_source.max_delay);
|
||||
params.max_delay_ratio = WIRE2REAL(rx_message->data.ntp_source.max_delay_ratio);
|
||||
status = NSR_AddServer(&rem_addr, ¶ms);
|
||||
@@ -1268,7 +1268,8 @@ handle_add_peer(CMD_Request *rx_message, CMD_Reply *tx_message)
|
||||
params.maxpoll = ntohl(rx_message->data.ntp_source.maxpoll);
|
||||
params.presend_minpoll = ntohl(rx_message->data.ntp_source.presend_minpoll);
|
||||
params.authkey = ntohl(rx_message->data.ntp_source.authkey);
|
||||
params.online = ntohl(rx_message->data.ntp_source.online);
|
||||
params.online = ntohl(rx_message->data.ntp_source.flags) & REQ_ADDSRC_ONLINE ? 1 : 0;
|
||||
params.auto_offline = ntohl(rx_message->data.ntp_source.flags) & REQ_ADDSRC_AUTOOFFLINE ? 1 : 0;
|
||||
params.max_delay = WIRE2REAL(rx_message->data.ntp_source.max_delay);
|
||||
params.max_delay_ratio = WIRE2REAL(rx_message->data.ntp_source.max_delay_ratio);
|
||||
status = NSR_AddPeer(&rem_addr, ¶ms);
|
||||
|
||||
Reference in New Issue
Block a user