]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
sources: don't reset active status
authorMiroslav Lichvar <mlichvar@redhat.com>
Tue, 12 Nov 2019 17:04:48 +0000 (18:04 +0100)
committerMiroslav Lichvar <mlichvar@redhat.com>
Thu, 5 Mar 2020 15:02:15 +0000 (16:02 +0100)
Avoid resetting the active status when an NTP source changes its
address in NCR_ChangeRemoteAddress().

This will allow an NTP source to update its address with NTS-KE
hostname negotiation and continue in a special reference mode
(e.g. -q/-Q option).

sources.c

index 7193491233093ddf1928864ea8c98e653b041e12..2e6f45e513b28348f359f7a2a8be61eabb0bf4c7 100644 (file)
--- a/sources.c
+++ b/sources.c
@@ -249,6 +249,7 @@ SRC_Instance SRC_CreateNewInstance(uint32_t ref_id, SRC_Type type, int sel_optio
   result->index = n_sources;
   result->type = type;
   result->sel_options = sel_options;
+  result->active = 0;
 
   SRC_SetRefid(result, ref_id, addr);
   SRC_ResetInstance(result);
@@ -291,7 +292,6 @@ void SRC_DestroyInstance(SRC_Instance instance)
 void
 SRC_ResetInstance(SRC_Instance instance)
 {
-  instance->active = 0;
   instance->updates = 0;
   instance->reachability = 0;
   instance->reachability_size = 0;