]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Warn about AXFR streams that are incompatible with BIND 9.18
authorMark Andrews <marka@isc.org>
Thu, 16 Apr 2020 06:54:09 +0000 (16:54 +1000)
committerMark Andrews <marka@isc.org>
Mon, 20 Apr 2020 23:31:24 +0000 (09:31 +1000)
(cherry picked from commit 998b2d5a57d97bea49c69a6ad8a7da5c7d129d6f)

CHANGES
lib/dns/xfrin.c

diff --git a/CHANGES b/CHANGES
index 407105a66df9649b5d6ad3c8ae444a4deed03b79..58ca6d13b555c0cc83d5e7985d5a9cae3fa5823e 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+5387.  [func]          Warn about AXFR streams that are incompatible with
+                       BIND 9.17.2.  [GL #1674]
+
        --- 9.11.18 released ---
 
 5380.  [contrib]       Fix building MySQL DLZ modules against MySQL 8
index 2b7a86d8bede6425554ea7e60d6aa09714e0900f..1e2f4d47e6afdd30daf879bbc40a9d3380a8a21d 100644 (file)
@@ -110,7 +110,7 @@ struct dns_xfrin_ctx {
        dns_name_t              name;           /*%< Name of zone to transfer */
        dns_rdataclass_t        rdclass;
 
-       bool            checkid;
+       bool                    checkid, logit;
        dns_messageid_t         id;
 
        /*%
@@ -852,6 +852,7 @@ xfrin_create(isc_mem_t *mctx,
        isc_random_get(&tmp);
        xfr->checkid = true;
        xfr->id = (uint16_t)(tmp & 0xffff);
+       xfr->logit = true;
        xfr->reqtype = reqtype;
        xfr->dscp = dscp;
 
@@ -1153,6 +1154,7 @@ xfrin_send_request(dns_xfrin_ctx_t *xfr) {
                                          &xfr->ixfr.request_serial));
 
        xfr->checkid = true;
+       xfr->logit = true;
        xfr->id++;
        xfr->nmsg = 0;
        xfr->nrecs = 0;
@@ -1311,6 +1313,12 @@ xfrin_recv_done(isc_task_t *task, isc_event_t *ev) {
                xfr->state = XFRST_SOAQUERY;
                (void)xfrin_start(xfr);
                return;
+       } else if (!xfr->checkid && msg->id != xfr->id && xfr->logit) {
+               xfrin_log(xfr, ISC_LOG_WARNING,
+                         "detected message ID mismatch on incoming AXFR "
+                         "stream, transfer will fail in BIND 9.17.2 and "
+                         "later if AXFR source is not fixed");
+               xfr->logit = false;
        }
 
        /*