From 840eaa628d9178ed7ceee0ec1a0796325fe08b1c Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Mon, 14 Oct 2024 14:09:03 +1100 Subject: [PATCH 1/2] Fix recursive-clients 0 Setting recursive-clients 0 triggered an assertion in isc_quota_soft. This has now been fixed. --- lib/isc/quota.c | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/isc/quota.c b/lib/isc/quota.c index a4ddebc612..0b1f050ce7 100644 --- a/lib/isc/quota.c +++ b/lib/isc/quota.c @@ -36,7 +36,6 @@ isc_quota_init(isc_quota_t *quota, unsigned int max) { void isc_quota_soft(isc_quota_t *quota, unsigned int soft) { REQUIRE(VALID_QUOTA(quota)); - REQUIRE(atomic_load_relaxed("a->max) > soft); atomic_store_relaxed("a->soft, soft); } From 677abded6b7457f5af79079191082b0b3ccccdc8 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Mon, 14 Oct 2024 14:15:27 +1100 Subject: [PATCH 2/2] Add regression test for [GL #4987] --- bin/tests/system/resolver/ns9/named.conf.in | 1 + tests/isc/quota_test.c | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/bin/tests/system/resolver/ns9/named.conf.in b/bin/tests/system/resolver/ns9/named.conf.in index 140cd26b58..bfc979ca6f 100644 --- a/bin/tests/system/resolver/ns9/named.conf.in +++ b/bin/tests/system/resolver/ns9/named.conf.in @@ -19,6 +19,7 @@ options { listen-on { none; }; listen-on-v6 { fd92:7065:b8e:ffff::9; }; recursion yes; + recursive-clients 0; // regression test for [GL #4987] dnssec-validation yes; dual-stack-servers { fd92:7065:b8e:ffff::7; }; qname-minimization off; diff --git a/tests/isc/quota_test.c b/tests/isc/quota_test.c index 59e865852d..25753d59a4 100644 --- a/tests/isc/quota_test.c +++ b/tests/isc/quota_test.c @@ -53,6 +53,11 @@ ISC_RUN_TEST_IMPL(isc_quota_get_set) { assert_int_equal(isc_quota_getused("a), 1); isc_quota_release("a); assert_int_equal(isc_quota_getused("a), 0); + + /* Unlimited */ + isc_quota_max("a, 0); + isc_quota_soft("a, 0); + isc_quota_destroy("a); }