]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
pullup:
authorMark Andrews <marka@isc.org>
Mon, 14 May 2001 03:22:08 +0000 (03:22 +0000)
committerMark Andrews <marka@isc.org>
Mon, 14 May 2001 03:22:08 +0000 (03:22 +0000)
 827.   [bug]           When an IXFR protocol error occurs, the slave
                        should retry with AXFR.

 826.   [bug]           Some IXFR protocol errors were not detected.

CHANGES
lib/dns/include/dns/result.h
lib/dns/rbtdb.c
lib/dns/result.c
lib/dns/xfrin.c
lib/dns/zone.c

diff --git a/CHANGES b/CHANGES
index cd6b7994f314b0ff5a4b46c718a06bf908e6c7b0..7937d4ac6f292a9a2b17f19f348094ddae782a8d 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,7 @@
+ 827.  [bug]           When an IXFR protocol error occurs, the slave
+                       should retry with AXFR.
+
+ 826.  [bug]           Some IXFR protocol errors were not detected.
 
  825.  [bug]           zone.c:ns_query() detached from the wrong zone
                        reference.  [RT #1264] 
index ca39cc5550ab7fe67879a2a0abd56d897f424eab..426fdae97b545f0fa003da28d8927272c202061c 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: result.h,v 1.76.2.2 2001/03/01 20:58:19 bwelling Exp $ */
+/* $Id: result.h,v 1.76.2.3 2001/05/14 03:22:08 marka Exp $ */
 
 #ifndef DNS_RESULT_H
 #define DNS_RESULT_H 1
 #define DNS_R_SINGLETON                        (ISC_RESULTCLASS_DNS + 72)
 #define DNS_R_HINTNXRRSET              (ISC_RESULTCLASS_DNS + 73)
 #define DNS_R_NOMASTERFILE             (ISC_RESULTCLASS_DNS + 74)
+#define DNS_R_UNKNOWNPROTO             (ISC_RESULTCLASS_DNS + 75)
+#define DNS_R_CLOCKSKEW                        (ISC_RESULTCLASS_DNS + 76)
+#define DNS_R_BADIXFR                  (ISC_RESULTCLASS_DNS + 77)
 
-#define DNS_R_NRESULTS                 75      /* Number of results */
+#define DNS_R_NRESULTS                 78      /* Number of results */
 
 /*
  * DNS wire format rcodes.
index 17f49e298669dffafe0c1ed6fbd33fb5474cdfa0..72b797c444af18ea6139e7eb5f022363237b35ad 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: rbtdb.c,v 1.139.4.6 2001/03/27 00:12:30 bwelling Exp $ */
+/* $Id: rbtdb.c,v 1.139.4.7 2001/05/14 03:22:02 marka Exp $ */
 
 /*
  * Principal Author: Bob Halley
@@ -3677,7 +3677,10 @@ subtractrdataset(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version,
                 * to satisfy the deletion request.
                 */
                free_rdataset(rbtdb->common.mctx, newheader);
-               result = DNS_R_UNCHANGED;
+               if ((options & DNS_DBSUB_EXACT) != 0)
+                       result = DNS_R_NOTEXACT;
+               else
+                       result = DNS_R_UNCHANGED;                       
        }
 
        if (result == ISC_R_SUCCESS && newrdataset != NULL)
index 0308da3fe691dffd708364f4b13d561cbb387d3a..0f2b0a880211961c91950319509945abd09b4f17 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: result.c,v 1.84.2.2 2001/03/01 20:58:16 bwelling Exp $ */
+/* $Id: result.c,v 1.84.2.3 2001/05/14 03:22:04 marka Exp $ */
 
 #include <config.h>
 
@@ -109,12 +109,16 @@ static const char *text[DNS_R_NRESULTS] = {
        "not exact",                           /* 67 DNS_R_NOTEXACT          */
        "address blackholed",                  /* 68 DNS_R_BLACKHOLED        */
        "bad algorithm",                       /* 69 DNS_R_BADALG            */
-       "invalid use of a meta type",          /* 70 DNS_R_METATYPE          */
 
+       "invalid use of a meta type",          /* 70 DNS_R_METATYPE          */
        "CNAME and other data",                /* 71 DNS_R_CNAMEANDOTHER     */
        "multiple RRs of singleton type",      /* 72 DNS_R_SINGLETON         */
        "hint nxrrset",                        /* 73 DNS_R_HINTNXRRSET       */
-       "no master file configured"            /* 74 DNS_R_NOMASTERFILE      */
+       "no master file configured",           /* 74 DNS_R_NOMASTERFILE      */
+       
+       "unknown protocol",                    /* 75 DNS_R_UNKNOWNPROTO      */
+       "clocks are unsynchronized",           /* 76 DNS_R_CLOCKSKEW         */
+       "IXFR failed"                          /* 77 DNS_R_BADIXFR           */
 };
 
 static const char *rcode_text[DNS_R_NRCODERESULTS] = {
index a8a252cc086b652a70069e1b4e0f07ba53eba4b9..0b5c6492b4b8a5c84808c7bc6ba3e2c27e798336 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: xfrin.c,v 1.109.2.2 2001/04/11 19:21:32 gson Exp $ */
+/* $Id: xfrin.c,v 1.109.2.3 2001/05/14 03:22:05 marka Exp $ */
 
 #include <config.h>
 
@@ -382,7 +382,7 @@ static isc_result_t
 ixfr_commit(dns_xfrin_ctx_t *xfr) {
        isc_result_t result;
 
-       ixfr_apply(xfr);
+       CHECK(ixfr_apply(xfr));
        if (xfr->ver != NULL) {
                /* XXX enter ready-to-commit state here */
                if (xfr->ixfr.journal != NULL)
@@ -645,6 +645,9 @@ xfrin_fail(dns_xfrin_ctx_t *xfr, isc_result_t result, const char *msg) {
        if (result != DNS_R_UPTODATE) {
                xfrin_log(xfr, ISC_LOG_ERROR, "%s: %s",
                          msg, isc_result_totext(result));
+               if (xfr->is_ixfr)
+                       /* Pass special result code to force AXFR retry */
+                       result = DNS_R_BADIXFR;
        }
        xfrin_cancelio(xfr);
        if (xfr->done != NULL) {
@@ -723,8 +726,7 @@ xfrin_create(isc_mem_t *mctx,
        xfr->lasttsig = NULL;
        xfr->tsigctx = NULL;
        xfr->sincetsig = 0;
-
-       /* is_ixfr */
+       xfr->is_ixfr = ISC_FALSE;
 
        /* ixfr.request_serial */
        /* ixfr.end_serial */
index d9bb002f687a8b3bcae67870467b1c7788c4ffe0..952016e1c0afda9e6d6cd32f7d8af3597125508c 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: zone.c,v 1.283.2.10 2001/05/10 21:52:01 gson Exp $ */
+/* $Id: zone.c,v 1.283.2.11 2001/05/14 03:22:06 marka Exp $ */
 
 #include <config.h>
 
@@ -248,6 +248,7 @@ struct dns_zone {
 #define DNS_ZONEFLG_DIALNOTIFY 0x00020000U
 #define DNS_ZONEFLG_DIALREFRESH        0x00040000U
 #define DNS_ZONEFLG_SHUTDOWN   0x00080000U
+#define DNS_ZONEFLAG_NOIXFR    0x00100000U     /* IXFR failed, force AXFR */
 
 #define DNS_ZONE_OPTION(z,o) (((z)->options & (o)) != 0)
 
@@ -4667,6 +4668,11 @@ zone_xfrdone(dns_zone_t *zone, isc_result_t result) {
 
                break;
 
+       case DNS_R_BADIXFR:
+               /* Force retry with AXFR. */
+               DNS_ZONE_SETFLAG(zone, DNS_ZONEFLAG_NOIXFR);
+               goto same_master;
+
        default:
                zone->curmaster++;
        same_master:
@@ -4845,6 +4851,14 @@ got_transfer_quota(isc_task_t *task, isc_event_t *event) {
                         "forced reload, requesting AXFR of "
                         "initial version from %s", mastertext);
                xfrtype = dns_rdatatype_axfr;
+       } else if (DNS_ZONE_FLAG(zone, DNS_ZONEFLAG_NOIXFR)) {
+               zone_log(zone, me, ISC_LOG_DEBUG(3),
+                            "retrying with AXFR from %s due to "
+                            "previous IXFR failure", mastertext);
+               xfrtype = dns_rdatatype_axfr;
+               LOCK_ZONE(zone);
+               DNS_ZONE_CLRFLAG(zone, DNS_ZONEFLAG_NOIXFR);
+               UNLOCK_ZONE(zone);
        } else {
                isc_boolean_t use_ixfr = ISC_TRUE;
                if (peer != NULL &&
@@ -4911,7 +4925,6 @@ got_transfer_quota(isc_task_t *task, isc_event_t *event) {
 
        dns_zone_detach(&zone); /* XXXAG */
        return;
-
 }
 
 /*