diff --git a/lib/dns/include/dns/rpz.h b/lib/dns/include/dns/rpz.h index 0c12da6e9d..e8f5170ca7 100644 --- a/lib/dns/include/dns/rpz.h +++ b/lib/dns/include/dns/rpz.h @@ -144,15 +144,14 @@ struct dns_rpz_zone { isc_ht_t *nodes; /* entries in zone */ dns_rpz_zones_t *rpzs; /* owner */ isc_time_t lastupdated; /* last time the zone was processed */ - bool updatepending; /* there is an update pending/waiting */ - bool updaterunning; /* there is an update running */ + bool updatepending; /* there is an update pending/waiting */ + bool updaterunning; /* there is an update running */ dns_db_t *db; /* zones database */ dns_dbversion_t *dbversion; /* version we will be updating to */ dns_db_t *updb; /* zones database we're working on */ dns_dbversion_t *updbversion; /* version we're currently working on */ dns_dbiterator_t *updbit; /* iterator to use when updating */ isc_ht_t *newnodes; /* entries in zone being updated */ - bool db_registered; /* is the notify event registered? */ isc_timer_t *updatetimer; isc_event_t updateevent; }; diff --git a/lib/dns/rpz.c b/lib/dns/rpz.c index d7112b01ed..83f8f7d6c5 100644 --- a/lib/dns/rpz.c +++ b/lib/dns/rpz.c @@ -1549,7 +1549,6 @@ dns_rpz_new_zone(dns_rpz_zones_t *rpzs, dns_rpz_zone_t **rpzp) { zone->updbversion = NULL; zone->updbit = NULL; zone->rpzs = rpzs; - zone->db_registered = false; ISC_EVENT_INIT(&zone->updateevent, sizeof(zone->updateevent), 0, NULL, 0, NULL, NULL, NULL, NULL, NULL); @@ -1584,7 +1583,6 @@ dns_rpz_dbupdate_callback(dns_db_t *db, void *fn_arg) { REQUIRE(zone != NULL); LOCK(&zone->rpzs->maint_lock); - REQUIRE(zone->db_registered); /* New zone came as AXFR */ if (zone->db != NULL && zone->db != db) { @@ -2100,10 +2098,8 @@ rpz_detach(dns_rpz_zone_t **rpzp, dns_rpz_zones_t *rpzs) { dns_db_closeversion(rpz->db, &rpz->dbversion, false); } if (rpz->db != NULL) { - if (rpz->db_registered) { - dns_db_updatenotify_unregister( - rpz->db, dns_rpz_dbupdate_callback, rpz); - } + dns_db_updatenotify_unregister( + rpz->db, dns_rpz_dbupdate_callback, rpz); dns_db_detach(&rpz->db); } if (rpz->updaterunning) { diff --git a/lib/dns/zone.c b/lib/dns/zone.c index 457e47b927..28f353a2ea 100644 --- a/lib/dns/zone.c +++ b/lib/dns/zone.c @@ -1786,7 +1786,6 @@ dns_zone_rpz_enable_db(dns_zone_t *zone, dns_db_t *db) { if (zone->rpz_num == DNS_RPZ_INVALID_NUM) return; REQUIRE(zone->rpzs != NULL); - zone->rpzs->zones[zone->rpz_num]->db_registered = true; result = dns_db_updatenotify_register(db, dns_rpz_dbupdate_callback, zone->rpzs->zones[zone->rpz_num]);