From: Aram Sargsyan Date: Mon, 25 Sep 2023 12:33:29 +0000 (+0000) Subject: Fix return value and docs for dns_zone_getxfr() X-Git-Tag: v9.19.18~62^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f9bcabff244b05692e790d74e5df433f9f1f063d;p=thirdparty%2Fbind9.git Fix return value and docs for dns_zone_getxfr() When the given zone is not associated with a zone manager, the function currently returns ISC_R_NOTFOUND, which is documented as the return value for the case in which no incoming zone transfer is found. Make the function return ISC_R_FAILURE in such a case instead. Also update the description of the function as the value it returns is not meant to indicate whether an ongoing incoming transfer for the given zone exists. The boolean variables that the function sets via the pointers provided as its parameters, combined with either keeping '*xfrp' set to NULL or updating it to a valid pointer, can be used by the caller to infer all the necessary information. --- diff --git a/lib/dns/include/dns/zone.h b/lib/dns/include/dns/zone.h index 694104659ef..2e3b10ebfae 100644 --- a/lib/dns/include/dns/zone.h +++ b/lib/dns/include/dns/zone.h @@ -1856,9 +1856,8 @@ dns_zone_getxfr(dns_zone_t *zone, dns_xfrin_t **xfrp, bool *is_running, *\li 'needs_refresh' to be non NULL. * * Returns: - * ISC_R_SUCCESS xfrin exists and the information was returned. - * ISC_R_NOTFOUND no xfrin was found for the zone. - * ISC_R_FAILED error while trying to get the xfrin information + * ISC_R_SUCCESS transfer information is returned + * ISC_R_FAILURE error while trying to get the transfer information */ void diff --git a/lib/dns/zone.c b/lib/dns/zone.c index 3c6d4557f5e..65bbde5946f 100644 --- a/lib/dns/zone.c +++ b/lib/dns/zone.c @@ -19293,7 +19293,7 @@ dns_zone_getxfr(dns_zone_t *zone, dns_xfrin_t **xfrp, bool *is_running, REQUIRE(xfrp != NULL && *xfrp == NULL); if (zone->zmgr == NULL) { - return (ISC_R_NOTFOUND); + return (ISC_R_FAILURE); } /* Reset. */