From: Danny Mayer Date: Thu, 25 May 2006 02:01:55 +0000 (-0400) Subject: Bug #504 Allow forced DNS retry even on failure only if macro FORCE_DNSRETRY is defined X-Git-Tag: NTP_4_2_1P254_RC~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dee28f9369bf868074f458615053ea04408c8a3b;p=thirdparty%2Fntp.git Bug #504 Allow forced DNS retry even on failure only if macro FORCE_DNSRETRY is defined bk: 44751013Yvnegas9M2H10aPyXO9mvw --- diff --git a/ntpd/ntp_intres.c b/ntpd/ntp_intres.c index 1ea07ce4d..6f529eb94 100644 --- a/ntpd/ntp_intres.c +++ b/ntpd/ntp_intres.c @@ -15,6 +15,11 @@ * might go about autoconfiguring an NTP distribution network. * */ + /* + * For special situations define the FORCE_DNSRETRY Macro + * to force retries even if it fails the lookup. + * Use with extreme caution since it will then retry forever. + */ #ifdef HAVE_CONFIG_H # include @@ -525,6 +530,10 @@ findhostaddr( (char *)&entry->ce_name, MAXHOSTNAMELEN, NULL, 0, 0); } +#ifdef DEBUG + if (debug > 2) + printf("intres: got error status of: %d\n", error); +#endif /* * If the resolver failed, see if the failure is @@ -536,7 +545,11 @@ findhostaddr( case EAI_AGAIN: return (1); case EAI_NONAME: +#ifndef FORCE_DNSRETRY return (0); +#else + return (1); +#endif #if defined(EAI_NODATA) && (EAI_NODATA != EAI_NONAME) case EAI_NODATA: #endif