in rdbdb.c:setsigningtime stop breaking heap invariant property unless we are going to restore the invariant property

(cherry picked from commit 6ead410268)
This commit is contained in:
Mark Andrews 2017-11-24 08:47:52 +11:00
parent 2a44ffeed8
commit 889cc681eb

View file

@ -7694,8 +7694,16 @@ setsigningtime(dns_db_t *db, dns_rdataset_t *rdataset, isc_stdtime_t resign) {
isc_rwlocktype_write);
oldheader = *header;
header->resign = (isc_stdtime_t)(dns_time64_from32(resign) >> 1);
header->resign_lsb = resign & 0x1;
/*
* Only break the heap invariant (by adjusting resign and resign_lsb)
* if we are going to be restoring it by calling isc_heap_increased
* or isc_heap_decreased.
*/
if (resign != 0) {
header->resign =
(isc_stdtime_t)(dns_time64_from32(resign) >> 1);
header->resign_lsb = resign & 0x1;
}
if (header->heap_index != 0) {
INSIST(RESIGN(header));
if (resign == 0) {