]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
pullup:
authorBrian Wellington <source@isc.org>
Wed, 28 Feb 2001 21:20:32 +0000 (21:20 +0000)
committerBrian Wellington <source@isc.org>
Wed, 28 Feb 2001 21:20:32 +0000 (21:20 +0000)
 759.   [bug]           The resolver didn't turn off "avoid fetches" mode
                        when restarting, possibly causing resolution
                        to fail when it should not.  This bug only affected
                        platforms which support both IPv4 and IPv6. [RT #927]

 758.   [bug]           The "avoid fetches" code did not treat negative
                        cache entries correctly, causing fetches that would
                        be useful to be avoided.  This bug only affected
                        platforms which support both IPv4 and IPv6. [RT #927]

CHANGES
lib/dns/adb.c
lib/dns/include/dns/adb.h
lib/dns/resolver.c

diff --git a/CHANGES b/CHANGES
index 8b2a34f44f12df7aa81f3d99fccad63cef6ec6fc..c0eb0ed08b64a43615b52e49afd9401d30175918 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,12 @@
+ 759.  [bug]           The resolver didn't turn off "avoid fetches" mode
+                       when restarting, possibly causing resolution
+                       to fail when it should not.  This bug only affected
+                       platforms which support both IPv4 and IPv6. [RT #927]
+
+ 758.  [bug]           The "avoid fetches" code did not treat negative
+                       cache entries correctly, causing fetches that would
+                       be useful to be avoided.  This bug only affected
+                       platforms which support both IPv4 and IPv6. [RT #927]
 
        --- 9.1.1rc3 released ---
 
index 6949a2521bc5848e3bda799a1f502c60ad90ce79..a1466531d55ba7204791d8e8eb45c245141b81b5 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: adb.c,v 1.162.2.2 2001/01/30 22:26:09 gson Exp $ */
+/* $Id: adb.c,v 1.162.2.3 2001/02/28 21:20:29 bwelling Exp $ */
 
 /*
  * Implementation notes
@@ -2432,7 +2432,7 @@ dns_adb_createfind(dns_adb_t *adb, isc_task_t *task, isc_taskaction_t action,
        dns_adbfind_t *find;
        dns_adbname_t *adbname;
        int bucket;
-       isc_boolean_t want_event, start_at_root, alias;
+       isc_boolean_t want_event, start_at_root, alias, have_address;
        isc_result_t result;
        unsigned int wanted_addresses;
        unsigned int wanted_fetches;
@@ -2664,8 +2664,13 @@ dns_adb_createfind(dns_adb_t *adb, isc_task_t *task, isc_taskaction_t action,
        }
 
  fetch:
+       if ((WANT_INET(wanted_addresses) && NAME_HAS_V4(adbname)) ||
+           (WANT_INET6(wanted_addresses) && NAME_HAS_V6(adbname)))
+               have_address = ISC_TRUE;
+       else
+               have_address = ISC_FALSE;
        if (wanted_fetches != 0 &&
-           (!FIND_AVOIDFETCHES(find) || wanted_addresses == wanted_fetches)) {
+           ! (FIND_AVOIDFETCHES(find) && have_address)) {
                /*
                 * We're missing at least one address family.  Either the
                 * caller hasn't instructed us to avoid fetches, or we don't
index ea43878cfe270d1088fc5a30c610ed9342b4aed8..fa8044397fc7639a05c0f3ba6fedf14eaf2bb029 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: adb.h,v 1.60.4.1 2001/01/09 22:45:02 bwelling Exp $ */
+/* $Id: adb.h,v 1.60.4.2 2001/02/28 21:20:32 bwelling Exp $ */
 
 #ifndef DNS_ADB_H
 #define DNS_ADB_H 1
@@ -144,8 +144,12 @@ struct dns_adbfind {
  *     if one will actually be generated.
  *
  * _AVOIDFETCHES:
+ *     If set, fetches will not be generated unless no addresses are
+ *     available in any of the address families requested.
  *
  * _STARTATROOT:
+ *     Fetches will start at the root nameservers, instead of the closest
+ *     ancestor.  This is useful for reestablishing glue that has expired.
  *
  * _GLUEOK:
  * _HINTOK:
index 02d77f79eb6b92391b950f2ff8b9f48ef73a885e..e30d0fd54dff41f3c590363b7f79fcb0349abe94 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: resolver.c,v 1.187.2.7 2001/02/20 21:56:23 gson Exp $ */
+/* $Id: resolver.c,v 1.187.2.8 2001/02/28 21:20:31 bwelling Exp $ */
 
 #include <config.h>
 
@@ -1422,8 +1422,21 @@ fctx_getaddresses(fetchctx_t *fctx) {
         * Normal nameservers.
         */
 
-       stdoptions = DNS_ADBFIND_WANTEVENT | DNS_ADBFIND_EMPTYEVENT |
-               DNS_ADBFIND_AVOIDFETCHES;
+       stdoptions = DNS_ADBFIND_WANTEVENT | DNS_ADBFIND_EMPTYEVENT;
+       if (fctx->restarts == 1) {
+               /*
+                * To avoid sending out a flood of queries likely to
+                * result in NXRRSET, we suppress fetches for address
+                * families we don't have the first time through,
+                * provided that we have addresses in some family we
+                * can use.
+                *
+                * We don't want to set this option all the time, since
+                * if fctx->restarts > 1, we've clearly been having trouble
+                * with the addresses we had, so getting more could help.
+                */
+               stdoptions |= DNS_ADBFIND_AVOIDFETCHES;
+       }
        if (res->dispatchv4 != NULL)
                stdoptions |= DNS_ADBFIND_INET;
        if (res->dispatchv6 != NULL)