Commit ca70688b authored by Mark Andrews's avatar Mark Andrews
Browse files

1383. [func] Track the serial number in a IXFR response and log if

                        a mismatch occurs.  This is a more specific error than
                        "not exact". [RT #3445]
parent 1132dac4
1383. [func] Track the serial number in a IXFR response and log if
a mismatch occurs. This is a more specific error than
"not exact". [RT #3445]
1382. [bug] make install failed with --enable-libbind. [RT #3656] 1382. [bug] make install failed with --enable-libbind. [RT #3656]
1381. [bug] named failed to correctly process answers that 1381. [bug] named failed to correctly process answers that
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $Id: xfrin.c,v 1.129 2001/11/30 01:59:24 gson Exp $ */ /* $Id: xfrin.c,v 1.130 2002/09/24 01:04:03 marka Exp $ */
#include <config.h> #include <config.h>
...@@ -158,7 +158,7 @@ struct dns_xfrin_ctx { ...@@ -158,7 +158,7 @@ struct dns_xfrin_ctx {
struct { struct {
isc_uint32_t request_serial; isc_uint32_t request_serial;
isc_uint32_t end_serial; isc_uint32_t current_serial;
dns_journal_t *journal; dns_journal_t *journal;
} ixfr; } ixfr;
...@@ -480,7 +480,7 @@ xfr_rr(dns_xfrin_ctx_t *xfr, dns_name_t *name, isc_uint32_t ttl, ...@@ -480,7 +480,7 @@ xfr_rr(dns_xfrin_ctx_t *xfr, dns_name_t *name, isc_uint32_t ttl,
if (rdata->type == dns_rdatatype_soa) { if (rdata->type == dns_rdatatype_soa) {
isc_uint32_t soa_serial = dns_soa_getserial(rdata); isc_uint32_t soa_serial = dns_soa_getserial(rdata);
xfr->state = XFRST_IXFR_ADDSOA; xfr->state = XFRST_IXFR_ADDSOA;
xfr->ixfr.end_serial = soa_serial; xfr->ixfr.current_serial = soa_serial;
goto redo; goto redo;
} }
CHECK(ixfr_putdata(xfr, DNS_DIFFOP_DEL, name, ttl, rdata)); CHECK(ixfr_putdata(xfr, DNS_DIFFOP_DEL, name, ttl, rdata));
...@@ -499,6 +499,12 @@ xfr_rr(dns_xfrin_ctx_t *xfr, dns_name_t *name, isc_uint32_t ttl, ...@@ -499,6 +499,12 @@ xfr_rr(dns_xfrin_ctx_t *xfr, dns_name_t *name, isc_uint32_t ttl,
if (soa_serial == xfr->end_serial) { if (soa_serial == xfr->end_serial) {
xfr->state = XFRST_END; xfr->state = XFRST_END;
break; break;
} else if (soa_serial != xfr->ixfr.current_serial) {
xfrin_log(xfr, ISC_LOG_ERROR,
"IXFR out of sync: "
"expected serial %u, got %u",
xfr->ixfr.current_serial, soa_serial);
FAIL(DNS_R_FORMERR);
} else { } else {
xfr->state = XFRST_IXFR_DELSOA; xfr->state = XFRST_IXFR_DELSOA;
goto redo; goto redo;
...@@ -727,7 +733,7 @@ xfrin_create(isc_mem_t *mctx, ...@@ -727,7 +733,7 @@ xfrin_create(isc_mem_t *mctx,
xfr->is_ixfr = ISC_FALSE; xfr->is_ixfr = ISC_FALSE;
/* ixfr.request_serial */ /* ixfr.request_serial */
/* ixfr.end_serial */ /* ixfr.current_serial */
xfr->ixfr.journal = NULL; xfr->ixfr.journal = NULL;
xfr->axfr.add_func = NULL; xfr->axfr.add_func = NULL;
...@@ -939,6 +945,7 @@ xfrin_send_request(dns_xfrin_ctx_t *xfr) { ...@@ -939,6 +945,7 @@ xfrin_send_request(dns_xfrin_ctx_t *xfr) {
CHECK(dns_db_createsoatuple(xfr->db, ver, xfr->mctx, CHECK(dns_db_createsoatuple(xfr->db, ver, xfr->mctx,
DNS_DIFFOP_EXISTS, &soatuple)); DNS_DIFFOP_EXISTS, &soatuple));
xfr->ixfr.request_serial = dns_soa_getserial(&soatuple->rdata); xfr->ixfr.request_serial = dns_soa_getserial(&soatuple->rdata);
xfr->ixfr.current_serial = xfr->ixfr.request_serial;
xfrin_log(xfr, ISC_LOG_DEBUG(3), xfrin_log(xfr, ISC_LOG_DEBUG(3),
"requesting IXFR for serial %u", "requesting IXFR for serial %u",
xfr->ixfr.request_serial); xfr->ixfr.request_serial);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment