]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Fix return value and docs for dns_zone_getxfr()
authorAram Sargsyan <aram@isc.org>
Mon, 25 Sep 2023 12:33:29 +0000 (12:33 +0000)
committerAram Sargsyan <aram@isc.org>
Wed, 27 Sep 2023 10:03:40 +0000 (10:03 +0000)
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.

lib/dns/include/dns/zone.h
lib/dns/zone.c

index 694104659ef267256d7c3f6f81ed2128135a53b7..2e3b10ebfaeaafee5ac4cdc5352ec9d0e4d1a8c8 100644 (file)
@@ -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
index 3c6d4557f5eeea21800215bc19f7c67f12d41513..65bbde5946f53b45a873cc798d417d0fd5615bee 100644 (file)
@@ -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. */