mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-06 18:55:06 -05:00
Add configure option to force retry on DNS failure
This is apparently needed on system which keep nameservers specified in /etc/resolv.conf even when there is no network connection. Should be used with care as invalid names will be retried forever.
This commit is contained in:
@@ -56,7 +56,11 @@ DNS_Name2IPAddress(const char *name, IPAddr *addr)
|
||||
result = getaddrinfo(name, NULL, &hints, &res);
|
||||
|
||||
if (result) {
|
||||
#ifdef FORCE_DNSRETRY
|
||||
return DNS_TryAgain;
|
||||
#else
|
||||
return result == EAI_AGAIN ? DNS_TryAgain : DNS_Failure;
|
||||
#endif
|
||||
}
|
||||
|
||||
for (ai = res; !result && ai != NULL; ai = ai->ai_next) {
|
||||
@@ -94,8 +98,13 @@ DNS_Name2IPAddress(const char *name, IPAddr *addr)
|
||||
return DNS_Success;
|
||||
}
|
||||
|
||||
#ifdef FORCE_DNSRETRY
|
||||
return DNS_TryAgain;
|
||||
#else
|
||||
return DNS_Failure;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
/* ================================================== */
|
||||
|
||||
Reference in New Issue
Block a user