ntp: avoid recursive update of address

Allow NSR_UpdateSourceNtpAddress() to be (indirectly) called from
NCR_CreateInstance() and NCR_ChangeRemoteAddress(). In these cases, save
the addresses and make the update later when the function calls return.
This commit is contained in:
Miroslav Lichvar
2021-02-09 16:06:36 +01:00
parent b0fc5832f4
commit 2e52aca3bf
2 changed files with 75 additions and 4 deletions

View File

@@ -91,7 +91,8 @@ extern void NSR_HandleBadSource(IPAddr *address);
/* Procedure to resolve all names again */
extern void NSR_RefreshAddresses(void);
/* Procedure to update the address of a source */
/* Procedure to update the address of a source. The update may be
postponed. */
extern NSR_Status NSR_UpdateSourceNtpAddress(NTP_Remote_Address *old_addr,
NTP_Remote_Address *new_addr);