]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
Bug #504 Allow forced DNS retry even on failure only if macro FORCE_DNSRETRY is defined
authorDanny Mayer <mayer@ntp.org>
Thu, 25 May 2006 02:01:55 +0000 (22:01 -0400)
committerDanny Mayer <mayer@ntp.org>
Thu, 25 May 2006 02:01:55 +0000 (22:01 -0400)
bk: 44751013Yvnegas9M2H10aPyXO9mvw

ntpd/ntp_intres.c

index 1ea07ce4d408a3cefc8a0be16aeda161725317d7..6f529eb94318972d81ce409f181f19d4049d6b14 100644 (file)
  * 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 <config.h>
@@ -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