From: Colin Vidal Date: Fri, 31 Oct 2025 11:15:00 +0000 (+0100) Subject: query_getzonedb can returns DNS_R_EXPIRED X-Git-Tag: v9.21.15~10^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=90b4f256a70e78ac9c095d3c21c3f45183fa6b32;p=thirdparty%2Fbind9.git query_getzonedb can returns DNS_R_EXPIRED If `query_getzonedb()` finds a zone but the zone is expired it immediately returns `DNS_R_EXPIRED` and doesn't attempt to get the zone DB (which would be NULL in this case). This enable caller to have a more precise reason of why getting the DB has failed. --- diff --git a/lib/ns/query.c b/lib/ns/query.c index 9f59e9a577f..b9bd2b892a6 100644 --- a/lib/ns/query.c +++ b/lib/ns/query.c @@ -1250,6 +1250,11 @@ query_getzonedb(ns_client_t *client, const dns_name_t *name, partial = true; } if (result == ISC_R_SUCCESS || result == DNS_R_PARTIALMATCH) { + if (dns_zone_isexpired(zone)) { + result = DNS_R_EXPIRED; + goto fail; + } + result = dns_zone_getdb(zone, &db); }