Re: [chrony-dev] [PATCH] local threshold option |
[ Thread Index |
Date Index
| More chrony.tuxfamily.org/chrony-dev Archives
]
- To: chrony-dev@xxxxxxxxxxxxxxxxxxxx
- Subject: Re: [chrony-dev] [PATCH] local threshold option
- From: Miroslav Lichvar <mlichvar@xxxxxxxxxx>
- Date: Thu, 4 Apr 2024 16:36:05 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1712241368; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=z11QHryVG86LRO3gz0nbOUzaquTv99U/R1SL91EfSnM=; b=WESK6hveUPiJ5ZeJtI/szza85bHA1YDDCgGq1JukIhO6bT94zZmQt/JtiPWEYd8Vk3frl7 zx1s8FurZNvU1P1ENOhC2hqeqoMCkPbTjJ2K4SaIDd+4sa5AsZc5pmW45coAgkDHoX/NoO 8ZcgMymMlMPXX7n8iroXaahPwxEqvj0=
On Fri, Mar 29, 2024 at 01:44:34AM +0000, Andy Fiddaman wrote:
> I've attached the latest patch.
>
> I'm happy to go back and do something here if you'd like, but also
> please feel free to adjust what I've done here to better fit the
> goals of the project.
I applied the patch with some fixes. I hope that's ok.
> @@ -1648,8 +1650,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;
The corresponding change is missing in client.c
> /* Local reference is active when enabled and the clock is not synchronised
> or the root distance exceeds the threshold */
> -
> if (are_we_synchronised &&
> - !(enable_local_stratum && our_root_delay / 2 + dispersion > local_distance)) {
> + !(enable_local_stratum && distance > local_distance)) {
This is missing local_activate_ok to prevent unsynchronized status
when the distance check passes but activation not. I added some tests
for that in a separate commit, so hopefully it works as expected.
>
> *is_synchronised = 1;
>
> @@ -1158,7 +1166,7 @@ REF_GetReferenceParams
> *root_delay = our_root_delay;
> *root_dispersion = dispersion;
>
> - } else if (enable_local_stratum) {
> + } else if (enable_local_stratum && local_activate_ok) {
>
> *is_synchronised = 0;
>
Thanks,
--
Miroslav Lichvar
--
To unsubscribe email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "unsubscribe" in the subject.
For help email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "help" in the subject.
Trouble? Email listmaster@xxxxxxxxxxxxxxxxxxxx.