|
|
|
@ -1,4 +1,4 @@
|
|
|
|
|
From 37ba012cf603f126f31ff7647d6ee4f6fe708e8f Mon Sep 17 00:00:00 2001
|
|
|
|
|
From b1871274cd2c97b63f3b90d608b7f8936d4ff3c5 Mon Sep 17 00:00:00 2001
|
|
|
|
|
From: Mark Andrews <marka@isc.org>
|
|
|
|
|
Date: Wed, 24 Aug 2022 12:21:50 +1000
|
|
|
|
|
Subject: [PATCH] Have dns_zt_apply lock the zone table
|
|
|
|
@ -16,8 +16,8 @@ Modified upstream commit for v9_16
|
|
|
|
|
lib/dns/include/dns/zt.h | 3 ++-
|
|
|
|
|
lib/dns/tests/zt_test.c | 4 ++--
|
|
|
|
|
lib/dns/view.c | 3 ++-
|
|
|
|
|
lib/dns/zt.c | 21 ++++++++++-----------
|
|
|
|
|
6 files changed, 30 insertions(+), 25 deletions(-)
|
|
|
|
|
lib/dns/zt.c | 29 ++++++++++++++++++-----------
|
|
|
|
|
6 files changed, 38 insertions(+), 25 deletions(-)
|
|
|
|
|
|
|
|
|
|
diff --git a/bin/named/server.c b/bin/named/server.c
|
|
|
|
|
index 860ccae..c2a5887 100644
|
|
|
|
@ -130,7 +130,7 @@ index 8c7e40a..dcb0f18 100644
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
diff --git a/lib/dns/zt.c b/lib/dns/zt.c
|
|
|
|
|
index 8ca9cd6..cb90950 100644
|
|
|
|
|
index 8ca9cd6..1bfc308 100644
|
|
|
|
|
--- a/lib/dns/zt.c
|
|
|
|
|
+++ b/lib/dns/zt.c
|
|
|
|
|
@@ -223,7 +223,8 @@ flush(dns_zone_t *zone, void *uap) {
|
|
|
|
@ -189,6 +189,28 @@ index 8ca9cd6..cb90950 100644
|
|
|
|
|
isc_result_t (*action)(dns_zone_t *, void *), void *uap) {
|
|
|
|
|
dns_rbtnode_t *node;
|
|
|
|
|
dns_rbtnodechain_t chain;
|
|
|
|
|
@@ -532,6 +531,10 @@ dns_zt_apply(dns_zt_t *zt, bool stop, isc_result_t *sub,
|
|
|
|
|
REQUIRE(VALID_ZT(zt));
|
|
|
|
|
REQUIRE(action != NULL);
|
|
|
|
|
|
|
|
|
|
+ if (lock != isc_rwlocktype_none) {
|
|
|
|
|
+ RWLOCK(&zt->rwlock, lock);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
dns_rbtnodechain_init(&chain);
|
|
|
|
|
result = dns_rbtnodechain_first(&chain, zt->table, NULL, NULL);
|
|
|
|
|
if (result == ISC_R_NOTFOUND) {
|
|
|
|
|
@@ -568,6 +571,10 @@ cleanup:
|
|
|
|
|
*sub = tresult;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
+ if (lock != isc_rwlocktype_none) {
|
|
|
|
|
+ RWUNLOCK(&zt->rwlock, lock);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
return (result);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
2.38.1
|
|
|
|
|
2.39.2
|
|
|
|
|
|
|
|
|
|