mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-05 12:25:07 -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:
10
configure
vendored
10
configure
vendored
@@ -102,6 +102,7 @@ For better control, use the options below.
|
|||||||
--disable-pps Disable PPS API support
|
--disable-pps Disable PPS API support
|
||||||
--disable-rtc Don't include RTC even on Linux
|
--disable-rtc Don't include RTC even on Linux
|
||||||
--disable-linuxcaps Disable Linux capabilities support
|
--disable-linuxcaps Disable Linux capabilities support
|
||||||
|
--enable-forcednsretry Force retry on DNS failure
|
||||||
|
|
||||||
Fine tuning of the installation directories:
|
Fine tuning of the installation directories:
|
||||||
--sysconfdir=DIR chrony.conf location [/etc]
|
--sysconfdir=DIR chrony.conf location [/etc]
|
||||||
@@ -162,6 +163,7 @@ feat_ipv6=1
|
|||||||
feat_pps=1
|
feat_pps=1
|
||||||
try_setsched=0
|
try_setsched=0
|
||||||
try_lockmem=0
|
try_lockmem=0
|
||||||
|
feat_forcednsretry=0
|
||||||
|
|
||||||
for option
|
for option
|
||||||
do
|
do
|
||||||
@@ -226,6 +228,9 @@ do
|
|||||||
--disable-linuxcaps)
|
--disable-linuxcaps)
|
||||||
feat_linuxcaps=0
|
feat_linuxcaps=0
|
||||||
;;
|
;;
|
||||||
|
--enable-forcednsretry)
|
||||||
|
feat_forcednsretry=1
|
||||||
|
;;
|
||||||
--host-system=* )
|
--host-system=* )
|
||||||
OPERATINGSYSTEM=`echo $option | sed -e 's/^.*=//;'`
|
OPERATINGSYSTEM=`echo $option | sed -e 's/^.*=//;'`
|
||||||
;;
|
;;
|
||||||
@@ -399,6 +404,11 @@ then
|
|||||||
SYSDEFS="${SYSDEFS} -DHAVE_MLOCKALL"
|
SYSDEFS="${SYSDEFS} -DHAVE_MLOCKALL"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ $feat_forcednsretry = "1" ]
|
||||||
|
then
|
||||||
|
EXTRA_DEFS="$EXTRA_DEFS -DFORCE_DNSRETRY=1"
|
||||||
|
fi
|
||||||
|
|
||||||
READLINE_COMPILE=""
|
READLINE_COMPILE=""
|
||||||
READLINE_LINK=""
|
READLINE_LINK=""
|
||||||
if [ $feat_readline = "1" ]; then
|
if [ $feat_readline = "1" ]; then
|
||||||
|
|||||||
@@ -56,7 +56,11 @@ DNS_Name2IPAddress(const char *name, IPAddr *addr)
|
|||||||
result = getaddrinfo(name, NULL, &hints, &res);
|
result = getaddrinfo(name, NULL, &hints, &res);
|
||||||
|
|
||||||
if (result) {
|
if (result) {
|
||||||
|
#ifdef FORCE_DNSRETRY
|
||||||
|
return DNS_TryAgain;
|
||||||
|
#else
|
||||||
return result == EAI_AGAIN ? DNS_TryAgain : DNS_Failure;
|
return result == EAI_AGAIN ? DNS_TryAgain : DNS_Failure;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
for (ai = res; !result && ai != NULL; ai = ai->ai_next) {
|
for (ai = res; !result && ai != NULL; ai = ai->ai_next) {
|
||||||
@@ -94,8 +98,13 @@ DNS_Name2IPAddress(const char *name, IPAddr *addr)
|
|||||||
return DNS_Success;
|
return DNS_Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef FORCE_DNSRETRY
|
||||||
|
return DNS_TryAgain;
|
||||||
|
#else
|
||||||
return DNS_Failure;
|
return DNS_Failure;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ================================================== */
|
/* ================================================== */
|
||||||
|
|||||||
Reference in New Issue
Block a user