mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 17:35:06 -05:00
ntp: update auth-specific address sooner
When replacing an NTP source, update the NTS address before the NTP address to save cookies with the old NTP address instead of the newly resolved address (which may immediately change to an address provided by NTS-KE).
This commit is contained in:
@@ -703,6 +703,11 @@ NCR_ChangeRemoteAddress(NCR_Instance inst, NTP_Remote_Address *remote_addr, int
|
||||
{
|
||||
memset(&inst->report, 0, sizeof (inst->report));
|
||||
NCR_ResetInstance(inst);
|
||||
|
||||
/* Update the authentication-specific address before NTP address */
|
||||
if (!ntp_only)
|
||||
NAU_ChangeAddress(inst->auth, &remote_addr->ip_addr);
|
||||
|
||||
inst->remote_addr = *remote_addr;
|
||||
|
||||
if (inst->mode == MODE_CLIENT)
|
||||
@@ -718,9 +723,6 @@ NCR_ChangeRemoteAddress(NCR_Instance inst, NTP_Remote_Address *remote_addr, int
|
||||
SRC_SetRefid(inst->source, UTI_IPToRefid(&remote_addr->ip_addr),
|
||||
&inst->remote_addr.ip_addr);
|
||||
SRC_ResetInstance(inst->source);
|
||||
|
||||
if (!ntp_only)
|
||||
NAU_ChangeAddress(inst->auth, &remote_addr->ip_addr);
|
||||
}
|
||||
|
||||
/* ================================================== */
|
||||
|
||||
Reference in New Issue
Block a user