mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 16:35:06 -05:00
reference: add "local activate" option
This option sets an activating root distance for the local reference. The local reference will not be used until the root distance drops below the configured value for the first time. This can be used to prevent the local reference from being activated on a server which has never been synchronised with an upstream server. The default value of 0.0 causes no activating distance to be used, such that the local reference is always eligible for activation.
This commit is contained in:
committed by
Miroslav Lichvar
parent
b8ead3485b
commit
9397ae2b0a
8
cmdmon.c
8
cmdmon.c
@@ -146,6 +146,7 @@ static const char permissions[] = {
|
||||
PERMIT_AUTH, /* DOFFSET2 */
|
||||
PERMIT_AUTH, /* MODIFY_SELECTOPTS */
|
||||
PERMIT_AUTH, /* MODIFY_OFFSET */
|
||||
PERMIT_AUTH, /* LOCAL3 */
|
||||
};
|
||||
|
||||
/* ================================================== */
|
||||
@@ -531,7 +532,8 @@ handle_local(CMD_Request *rx_message, CMD_Reply *tx_message)
|
||||
if (ntohl(rx_message->data.local.on_off)) {
|
||||
REF_EnableLocal(ntohl(rx_message->data.local.stratum),
|
||||
UTI_FloatNetworkToHost(rx_message->data.local.distance),
|
||||
ntohl(rx_message->data.local.orphan));
|
||||
ntohl(rx_message->data.local.orphan),
|
||||
UTI_FloatNetworkToHost(rx_message->data.local.activate));
|
||||
} else {
|
||||
REF_DisableLocal();
|
||||
}
|
||||
@@ -1649,8 +1651,8 @@ read_from_cmd_socket(int sock_fd, int event, void *anything)
|
||||
case REQ_SETTIME:
|
||||
handle_settime(&rx_message, &tx_message);
|
||||
break;
|
||||
|
||||
case REQ_LOCAL2:
|
||||
|
||||
case REQ_LOCAL3:
|
||||
handle_local(&rx_message, &tx_message);
|
||||
break;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user