ntp: don't keep refresh requests in list of unresolved sources
The refresh command adds requests to reresolve addresses of all sources.
If some sources didn't have an IP address resolved yet, the
corresponding requests were not removed after failed resolving. Repeated
refresh commands increased the number of requests and number of calls of
the system resolver, which might not be caching DNS responses.
Remove all refresh requests from the list after resolving attempt to fix
that.
Reported-by: t.barnewski@avm.de
Fixes: d7e3ad17ff
("ntp: create sources for unresolved addresses")
This commit is contained in:
parent
6d0143e963
commit
6e5513c80b
1 changed files with 4 additions and 2 deletions
|
@ -638,8 +638,10 @@ name_resolve_handler(DNS_Status status, int n_addrs, IPAddr *ip_addrs, void *any
|
|||
next = us->next;
|
||||
|
||||
/* Don't repeat the resolving if it (permanently) failed, it was a
|
||||
replacement of a real address, or all addresses are already resolved */
|
||||
if (status == DNS_Failure || UTI_IsIPReal(&us->address.ip_addr) || is_resolved(us))
|
||||
replacement of a real address, a refreshment, or all addresses are
|
||||
already resolved */
|
||||
if (status == DNS_Failure || UTI_IsIPReal(&us->address.ip_addr) ||
|
||||
us->refreshment || is_resolved(us))
|
||||
remove_unresolved_source(us);
|
||||
|
||||
/* If a restart was requested and this was the last source in the list,
|
||||
|
|
Loading…
Reference in a new issue