From: Colin Vidal Date: Wed, 19 Nov 2025 11:32:09 +0000 (+0100) Subject: small refactor for `max-query-restart` in `check.c` X-Git-Tag: v9.21.17~4^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4cf2efc97a40d2883587be19530a7e253af47c9a;p=thirdparty%2Fbind9.git small refactor for `max-query-restart` in `check.c` Use the `check_range_uint32()` function in `check.c` to test the boundaries of `max-query-restart` instead of custom code. --- diff --git a/lib/isccfg/check.c b/lib/isccfg/check.c index ca726b737f8..4e690b9d994 100644 --- a/lib/isccfg/check.c +++ b/lib/isccfg/check.c @@ -1999,19 +1999,7 @@ check_options(const cfg_obj_t *options, const cfg_obj_t *config, } } - obj = NULL; - (void)cfg_map_get(options, "max-query-restarts", &obj); - if (obj != NULL) { - uint32_t restarts = cfg_obj_asuint32(obj); - if (restarts == 0 || restarts > 255) { - cfg_obj_log(obj, ISC_LOG_ERROR, - "'max-query-restarts' is out of " - "range 1..255)"); - if (result == ISC_R_SUCCESS) { - result = ISC_R_RANGE; - } - } - } + check_range_uint32(options, &result, "max-query-restarts", 1, 255); obj = NULL; (void)cfg_map_get(options, "prefetch", &obj);