From da53179d1055c75e64dc2c9623b38cb2b8629eb6 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Tue, 7 Jun 2005 02:02:05 +0000 Subject: [PATCH] 1855. [bug] ixfr-from-differences was failing to detect changes of ttl due to dns_diff_subtract() was ignoring the ttl of records. [RT #14616] --- CHANGES | 4 +++- doc/private/branches | 2 +- lib/dns/journal.c | 14 +++++++++++--- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/CHANGES b/CHANGES index 42559c7ea4..5c8ca490f0 100644 --- a/CHANGES +++ b/CHANGES @@ -45,7 +45,9 @@ 1856. [doc] Switch Docbook toolchain from DSSSL to XSL. [RT #11398] -1855. [placeholder] rt14616 +1855. [bug] ixfr-from-differences was failing to detect changes + of ttl due to dns_diff_subtract() was ignoring the ttl + of records. [RT #14616] 1854. [bug] lwres also needs to know the print format for (long long). [RT #13754] diff --git a/doc/private/branches b/doc/private/branches index 4a26c8bea8..802c2e2e28 100644 --- a/doc/private/branches +++ b/doc/private/branches @@ -33,7 +33,7 @@ rt13606 open marka // TSIG SHA256 rt13662 open marka // rrset-order fixed rt13753 review rt13771 review -rt14616 review +rt14616 closed rt14673 closed rt14695 review rt14775 review diff --git a/lib/dns/journal.c b/lib/dns/journal.c index 0e024aed35..00345c5b18 100644 --- a/lib/dns/journal.c +++ b/lib/dns/journal.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: journal.c,v 1.91 2005/04/29 00:22:47 marka Exp $ */ +/* $Id: journal.c,v 1.92 2005/06/07 02:02:05 marka Exp $ */ #include @@ -1746,6 +1746,8 @@ dns_diff_subtract(dns_diff_t diff[2], dns_diff_t *r) { isc_result_t result; dns_difftuple_t *p[2]; int i, t; + isc_boolean_t append; + CHECK(dns_diff_sort(&diff[0], rdata_order)); CHECK(dns_diff_sort(&diff[1], rdata_order)); @@ -1774,11 +1776,17 @@ dns_diff_subtract(dns_diff_t diff[2], dns_diff_t *r) { } INSIST(t == 0); /* - * Identical RRs in both databases; skip them both. + * Identical RRs in both databases; skip them both + * if the ttl differs. */ + append = ISC_TF(p[0]->ttl != p[1]->ttl); for (i = 0; i < 2; i++) { ISC_LIST_UNLINK(diff[i].tuples, p[i], link); - dns_difftuple_free(&p[i]); + if (append) { + ISC_LIST_APPEND(r->tuples, p[i], link); + } else { + dns_difftuple_free(&p[i]); + } } next: ; }