3245. [bug] Don't report a error unchanged serials unless there

were other changes when thawing a zone with
                        ixfr-fromdifferences. [RT #26845]
This commit is contained in:
Mark Andrews 2011-12-19 23:46:13 +00:00
parent 6b067655a8
commit b290d10fc4
3 changed files with 40 additions and 2 deletions

View file

@ -1,3 +1,7 @@
3245. [bug] Don't report a error unchanged serials unless there
were other changes when thawing a zone with
ixfr-fromdifferences. [RT #26845]
3244. [func] Added readline support to nslookup and nsupdate.
Also simplified nsupdate syntax to make "update"
and "prereq" optional. [RT #24659]

View file

@ -14,7 +14,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
# $Id: tests.sh,v 1.9 2011/12/09 22:09:25 marka Exp $
# $Id: tests.sh,v 1.10 2011/12/19 23:46:13 marka Exp $
SYSTEMTESTTOP=..
. $SYSTEMTESTTOP/conf.sh
@ -548,6 +548,18 @@ done
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
echo "I:checking rndc freeze/thaw of dynamic inline zone no change ($n)"
ret=0
$RNDC -c ../common/rndc.conf -s 10.53.0.3 -p 9953 freeze dynamic > freeze.test$n 2>&1 || { echo "I: rndc freeze dynamic failed" ; sed 's/^/I:/' < freeze.test$n ; ret=1; }
sleep 1
$RNDC -c ../common/rndc.conf -s 10.53.0.3 -p 9953 thaw dynamic > thaw.test$n 2>&1 || { echo "I: rndc thaw dynamic failed" ; ret=1; }
sleep 1
grep "zone dynamic/IN (unsigned): ixfr-from-differences: unchanged" ns3/named.run > /dev/null || ret=1
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
echo "I:checking rndc freeze/thaw of dynamic inline zone ($n)"
ret=0

View file

@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: zone.c,v 1.654 2011/12/09 22:09:26 marka Exp $ */
/* $Id: zone.c,v 1.655 2011/12/19 23:46:12 marka Exp $ */
/*! \file */
@ -3524,6 +3524,20 @@ maybe_send_securedb(dns_zone_t *zone) {
UNLOCK_ZONE(zone->raw);
}
static isc_boolean_t
zone_unchanged(dns_db_t *db1, dns_db_t *db2, isc_mem_t *mctx) {
isc_result_t result;
isc_boolean_t answer = ISC_FALSE;
dns_diff_t diff;
dns_diff_init(mctx, &diff);
result = dns_db_diffx(&diff, db1, NULL, db2, NULL, NULL);
if (result == ISC_R_SUCCESS && ISC_LIST_EMPTY(diff.tuples))
answer = ISC_TRUE;
dns_diff_clear(&diff);
return (answer);
}
static isc_result_t
zone_postload(dns_zone_t *zone, dns_db_t *db, isc_time_t loadtime,
isc_result_t result)
@ -3755,6 +3769,14 @@ zone_postload(dns_zone_t *zone, dns_db_t *db, isc_time_t loadtime,
INSIST(zone->type == dns_zone_master);
if (serial == oldserial &&
zone_unchanged(zone->db, db, zone->mctx)) {
dns_zone_log(zone, ISC_LOG_INFO,
"ixfr-from-differences: "
"unchanged");
return(ISC_R_SUCCESS);
}
serialmin = (oldserial + 1) & 0xffffffffU;
serialmax = (oldserial + 0x7fffffffU) &
0xffffffffU;