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: d7e3ad17ff7a ("ntp: create sources for unresolved addresses")
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,