mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 23:15:07 -05:00
nts: rework update of NTP server address
In the NTS-NTP client instance, maintain a local copy of the NTP address instead of using a pointer to the NCR's address, which may change at unexpected times. Also, change the NNC_CreateInstance() to accept only the NTP port to make it clear the initial NTP address is the same as the NTS-KE address and to make it consistent with NNC_ChangeAddress(), which accepts only one address.
This commit is contained in:
@@ -571,7 +571,7 @@ NCR_CreateInstance(NTP_Remote_Address *remote_addr, NTP_Source_Type type,
|
||||
nts_address.ip_addr = remote_addr->ip_addr;
|
||||
nts_address.port = params->nts_port;
|
||||
|
||||
result->auth = NAU_CreateNtsInstance(&nts_address, name, &result->remote_addr);
|
||||
result->auth = NAU_CreateNtsInstance(&nts_address, name, result->remote_addr.port);
|
||||
} else if (params->authkey != INACTIVE_AUTHKEY) {
|
||||
result->auth = NAU_CreateSymmetricInstance(params->authkey);
|
||||
} else {
|
||||
@@ -703,7 +703,6 @@ 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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user