From e5565808e47386e63cfbc52efd38eb8b549ac5d9 Mon Sep 17 00:00:00 2001 From: Matthijs Mekking Date: Mon, 11 Feb 2019 17:30:04 +0100 Subject: [PATCH] Update CHANGES --- CHANGES | 4 ++++ lib/dns/zone.c | 17 +++++++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/CHANGES b/CHANGES index 3f45d92558..3ec56b9c9e 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ +5168. [bug] Do not crash on shutdown when RPZ fails to load. Also, + keep previous version of the database if RPZ fails to + load. [GL #813] + 5167. [bug] nxdomain-redirect could sometimes lookup the wrong redirect name. [GL #892] diff --git a/lib/dns/zone.c b/lib/dns/zone.c index 8eb4eb764e..735928e379 100644 --- a/lib/dns/zone.c +++ b/lib/dns/zone.c @@ -1783,8 +1783,9 @@ dns_zone_get_rpz_num(dns_zone_t *zone) { void dns_zone_rpz_enable_db(dns_zone_t *zone, dns_db_t *db) { isc_result_t result; - if (zone->rpz_num == DNS_RPZ_INVALID_NUM) + if (zone->rpz_num == DNS_RPZ_INVALID_NUM) { return; + } REQUIRE(zone->rpzs != NULL); result = dns_db_updatenotify_register(db, dns_rpz_dbupdate_callback, @@ -1794,14 +1795,13 @@ dns_zone_rpz_enable_db(dns_zone_t *zone, dns_db_t *db) { static void dns_zone_rpz_disable_db(dns_zone_t *zone, dns_db_t *db) { - isc_result_t result; - if (zone->rpz_num == DNS_RPZ_INVALID_NUM) + if (zone->rpz_num == DNS_RPZ_INVALID_NUM) { return; + } REQUIRE(zone->rpzs != NULL); - result = dns_db_updatenotify_unregister(db, - dns_rpz_dbupdate_callback, - zone->rpzs->zones[zone->rpz_num]); - REQUIRE(result == ISC_R_SUCCESS); + (void) dns_db_updatenotify_unregister(db, + dns_rpz_dbupdate_callback, + zone->rpzs->zones[zone->rpz_num]); } void @@ -1812,8 +1812,9 @@ dns_zone_catz_enable(dns_zone_t *zone, dns_catz_zones_t *catzs) { LOCK_ZONE(zone); INSIST(zone->catzs == NULL || zone->catzs == catzs); dns_catz_catzs_set_view(catzs, zone->view); - if (zone->catzs == NULL) + if (zone->catzs == NULL) { dns_catz_catzs_attach(catzs, &zone->catzs); + } UNLOCK_ZONE(zone); }