From: Evan Hunt Date: Tue, 3 Mar 2026 06:29:20 +0000 (-0800) Subject: Fix fetchlimit test failure X-Git-Tag: v9.21.21~4^2~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cd4a7a2d72737a992d80bcb9c4bfd30a97e5cbeb;p=thirdparty%2Fbind9.git Fix fetchlimit test failure When a referral lookup is triggered by a QMIN query, it should be exempt from the fetches-per-zone limit just as the QMIN query itself is. Also restart the test server between the fetches-per-server and fetches-per-zone tests so that leftover statistics from the former do not pollute the latter. Another fix is because zone spills and general query drops are no longer in a strict >= relation (on a parent-centric resolver), so check that both counters are non-zero instead. --- diff --git a/bin/tests/system/fetchlimit/tests.sh b/bin/tests/system/fetchlimit/tests.sh index c0910f32b1b..3d8a77397ab 100644 --- a/bin/tests/system/fetchlimit/tests.sh +++ b/bin/tests/system/fetchlimit/tests.sh @@ -167,7 +167,8 @@ if [ $ret != 0 ]; then echo_i "failed"; fi status=$((status + ret)) cp ns3/named2.conf ns3/named.conf -rndc_reconfig ns3 10.53.0.3 +stop_server --use-rndc --port ${CONTROLPORT} ns3 +start_server --noclean --restart --port ${PORT} ns3 n=$((n + 1)) echo_i "checking lame server clients are dropped at the per-domain limit ($n)" @@ -177,14 +178,17 @@ success=0 sendcmd 10.53.0.4 send-responses "disable" for try in 1 2 3 4 5; do burst 10.53.0.3 d $try 300 - $DIGCMD a ${try}.example >dig.out.ns3.$n.$try + $DIGCMD a ${try}.example >dig.out.ns3.$n.$try || true grep "status: NOERROR" dig.out.ns3.$n.$try >/dev/null 2>&1 \ && success=$((success + 1)) grep "status: SERVFAIL" dig.out.ns3.$n.$try >/dev/null 2>&1 \ && fail=$(($fail + 1)) stat 10.53.0.3 40 40 || ret=1 allowed=$(rndccmd 10.53.0.3 fetchlimit | awk '/lamesub/ { print $6 }') - [ "${allowed:-0}" -eq 40 ] || ret=1 + [ "${allowed:-0}" -eq 40 ] || { + echo_i "allowed ${allowed}/40" + ret=1 + } [ $ret -eq 1 ] && break sleep 1 done @@ -202,10 +206,9 @@ for try in 1 2 3 4 5; do sleep 1 done zspill=$(grep 'spilled due to zone' ns3/named.stats | sed 's/\([0-9][0-9]*\) spilled.*/\1/') -[ -z "$zspill" ] && zspill=0 +[ "${zspill:-0}" -ne 0 ] || ret=1 drops=$(grep 'queries dropped' ns3/named.stats | sed 's/\([0-9][0-9]*\) queries.*/\1/') -[ -z "$drops" ] && drops=0 -[ "$drops" -ge "$zspill" ] || ret=1 +[ "${drops:-0}" -ne 0 ] || ret=1 if [ $ret != 0 ]; then echo_i "failed"; fi status=$((status + ret)) diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c index c9e38fc678c..ab4344d74aa 100644 --- a/lib/dns/resolver.c +++ b/lib/dns/resolver.c @@ -9256,10 +9256,12 @@ rctx_referral(respctx_t *rctx) { fctx_minimize_qname(fctx); } - result = fcount_incr(fctx, false); - if (result != ISC_R_SUCCESS) { - rctx->result = result; - return ISC_R_COMPLETE; + if ((fctx->options & DNS_FETCHOPT_QMINFETCH) == 0) { + result = fcount_incr(fctx, false); + if (result != ISC_R_SUCCESS) { + rctx->result = result; + return ISC_R_COMPLETE; + } } /*