summaryrefslogtreecommitdiff
path: root/external
diff options
context:
space:
mode:
authorchristos <christos@NetBSD.org>2023-06-26 22:02:59 +0000
committerchristos <christos@NetBSD.org>2023-06-26 22:02:59 +0000
commita706c3b77df285fe88b974fb675975d899435aa3 (patch)
tree4d2014b5fba83365a4c1f3761d39fcbffa1e5163 /external
parent51f80bb2951ace01adfd5fe4138a3cee941ff3ea (diff)
merge conflicts between 9.16.37 and 9.16.42
Diffstat (limited to 'external')
-rw-r--r--external/mpl/bind/dist/bin/dig/dighost.c8
-rw-r--r--external/mpl/bind/dist/bin/named/controlconf.c12
-rw-r--r--external/mpl/bind/dist/bin/named/logconf.c8
-rw-r--r--external/mpl/bind/dist/bin/named/main.c10
-rw-r--r--external/mpl/bind/dist/bin/named/server.c58
-rw-r--r--external/mpl/bind/dist/bin/named/zoneconf.c168
-rw-r--r--external/mpl/bind/dist/bin/nsupdate/nsupdate.c13
-rw-r--r--external/mpl/bind/dist/bin/rndc/rndc.c4
-rw-r--r--external/mpl/bind/dist/bin/tests/optional/ratelimiter_test.c4
-rw-r--r--external/mpl/bind/dist/bin/tests/optional/rbt_test.c6
-rw-r--r--external/mpl/bind/dist/bin/tests/optional/shutdown_test.c8
-rw-r--r--external/mpl/bind/dist/bin/tests/optional/sock_test.c4
-rw-r--r--external/mpl/bind/dist/bin/tests/optional/task_test.c6
-rw-r--r--external/mpl/bind/dist/bin/tests/optional/timer_test.c8
-rw-r--r--external/mpl/bind/dist/bin/tests/system/feature-test.c18
-rw-r--r--external/mpl/bind/dist/bin/tests/system/logfileconfig/ns1/controls.conf.in18
-rw-r--r--external/mpl/bind/dist/bin/tests/system/logfileconfig/ns1/named.dirconf45
-rw-r--r--external/mpl/bind/dist/bin/tests/system/logfileconfig/ns1/named.iso860145
-rw-r--r--external/mpl/bind/dist/bin/tests/system/logfileconfig/ns1/named.iso8601-utc45
-rw-r--r--external/mpl/bind/dist/bin/tests/system/logfileconfig/ns1/named.pipeconf45
-rw-r--r--external/mpl/bind/dist/bin/tests/system/logfileconfig/ns1/named.plain53
-rw-r--r--external/mpl/bind/dist/bin/tests/system/logfileconfig/ns1/named.plainconf36
-rw-r--r--external/mpl/bind/dist/bin/tests/system/logfileconfig/ns1/named.symconf45
-rw-r--r--external/mpl/bind/dist/bin/tests/system/logfileconfig/ns1/named.tsconf55
-rw-r--r--external/mpl/bind/dist/bin/tests/system/logfileconfig/ns1/named.unlimited55
-rw-r--r--external/mpl/bind/dist/bin/tests/system/logfileconfig/ns1/named.versconf55
-rw-r--r--external/mpl/bind/dist/bin/tests/system/logfileconfig/ns1/rndc.conf.in26
-rw-r--r--external/mpl/bind/dist/bin/tests/system/logfileconfig/ns1/root.db27
-rw-r--r--external/mpl/bind/dist/bin/tests/system/ttl/tests.sh46
-rwxr-xr-xexternal/mpl/bind/dist/configure205
-rw-r--r--external/mpl/bind/dist/doc/man/named-compilezone.1in206
-rw-r--r--external/mpl/bind/dist/fuzz/fuzz.h14
-rw-r--r--external/mpl/bind/dist/lib/dns/catz.c20
-rw-r--r--external/mpl/bind/dist/lib/dns/dnsrps.c3
-rw-r--r--external/mpl/bind/dist/lib/dns/hmac_link.c3
-rw-r--r--external/mpl/bind/dist/lib/dns/include/dns/view.h17
-rw-r--r--external/mpl/bind/dist/lib/dns/include/dns/zt.h3
-rw-r--r--external/mpl/bind/dist/lib/dns/keymgr.c12
-rw-r--r--external/mpl/bind/dist/lib/dns/keytable.c13
-rw-r--r--external/mpl/bind/dist/lib/dns/master.c4
-rw-r--r--external/mpl/bind/dist/lib/dns/nsec3.c7
-rw-r--r--external/mpl/bind/dist/lib/dns/nta.c9
-rw-r--r--external/mpl/bind/dist/lib/dns/rbt.c12
-rw-r--r--external/mpl/bind/dist/lib/dns/rbtdb.c131
-rw-r--r--external/mpl/bind/dist/lib/dns/request.c25
-rw-r--r--external/mpl/bind/dist/lib/dns/resolver.c12
-rw-r--r--external/mpl/bind/dist/lib/dns/rpz.c4
-rw-r--r--external/mpl/bind/dist/lib/dns/validator.c48
-rw-r--r--external/mpl/bind/dist/lib/dns/view.c102
-rw-r--r--external/mpl/bind/dist/lib/dns/xfrin.c6
-rw-r--r--external/mpl/bind/dist/lib/dns/zone.c91
-rw-r--r--external/mpl/bind/dist/lib/irs/getaddrinfo.c5
-rw-r--r--external/mpl/bind/dist/lib/irs/resconf.c10
-rw-r--r--external/mpl/bind/dist/lib/isc/include/isc/task.h27
-rw-r--r--external/mpl/bind/dist/lib/isc/include/isc/timer.h38
-rw-r--r--external/mpl/bind/dist/lib/isc/iterated_hash.c60
-rw-r--r--external/mpl/bind/dist/lib/isc/lib.c3
-rw-r--r--external/mpl/bind/dist/lib/isc/log.c21
-rw-r--r--external/mpl/bind/dist/lib/isc/mem.c9
-rw-r--r--external/mpl/bind/dist/lib/isc/netmgr/netmgr.c24
-rw-r--r--external/mpl/bind/dist/lib/isc/ratelimiter.c9
-rw-r--r--external/mpl/bind/dist/lib/isc/task.c38
-rw-r--r--external/mpl/bind/dist/lib/isc/tests/task_test.c22
-rw-r--r--external/mpl/bind/dist/lib/isc/tests/timer_test.c24
-rw-r--r--external/mpl/bind/dist/lib/isc/timer.c137
-rw-r--r--external/mpl/bind/dist/lib/ns/query.c69
-rw-r--r--external/mpl/bind/dist/tsan-suppressions.txt2
-rw-r--r--external/mpl/bind/lib/libisc/Makefile3
68 files changed, 1022 insertions, 1357 deletions
diff --git a/external/mpl/bind/dist/bin/dig/dighost.c b/external/mpl/bind/dist/bin/dig/dighost.c
index b44f98a86bf..e875f2a6a4c 100644
--- a/external/mpl/bind/dist/bin/dig/dighost.c
+++ b/external/mpl/bind/dist/bin/dig/dighost.c
@@ -1,4 +1,4 @@
-/* $NetBSD: dighost.c,v 1.14 2023/01/25 21:43:23 christos Exp $ */
+/* $NetBSD: dighost.c,v 1.15 2023/06/26 22:02:59 christos Exp $ */
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
@@ -1586,7 +1586,7 @@ clear_query(dig_query_t *query) {
debug("clear_query(%p)", query);
if (query->timer != NULL) {
- isc_timer_detach(&query->timer);
+ isc_timer_destroy(&query->timer);
}
lookup = query->lookup;
@@ -2702,7 +2702,7 @@ bringup_timer(dig_query_t *query, unsigned int default_timeout) {
debug("have local timeout of %d", local_timeout);
isc_interval_set(&l->interval, local_timeout, 0);
if (query->timer != NULL) {
- isc_timer_detach(&query->timer);
+ isc_timer_destroy(&query->timer);
}
result = isc_timer_create(timermgr, isc_timertype_once, NULL,
&l->interval, global_task, connect_timeout,
@@ -2726,7 +2726,7 @@ force_timeout(dig_query_t *query) {
* ourselves due to the duplicate events.
*/
if (query->timer != NULL) {
- isc_timer_detach(&query->timer);
+ isc_timer_destroy(&query->timer);
}
}
diff --git a/external/mpl/bind/dist/bin/named/controlconf.c b/external/mpl/bind/dist/bin/named/controlconf.c
index 537667aa090..49f7cfc0b06 100644
--- a/external/mpl/bind/dist/bin/named/controlconf.c
+++ b/external/mpl/bind/dist/bin/named/controlconf.c
@@ -1,4 +1,4 @@
-/* $NetBSD: controlconf.c,v 1.10 2023/01/25 21:43:23 christos Exp $ */
+/* $NetBSD: controlconf.c,v 1.11 2023/06/26 22:02:59 christos Exp $ */
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
@@ -179,7 +179,7 @@ maybe_free_connection(controlconnection_t *conn) {
}
if (conn->timer != NULL) {
- isc_timer_detach(&conn->timer);
+ isc_timer_destroy(&conn->timer);
}
if (conn->ccmsg_valid) {
@@ -572,10 +572,10 @@ control_timeout(isc_task_t *task, isc_event_t *event) {
UNUSED(task);
- isc_timer_detach(&conn->timer);
- maybe_free_connection(conn);
-
isc_event_free(&event);
+
+ isc_timer_destroy(&conn->timer);
+ maybe_free_connection(conn);
}
static isc_result_t
@@ -623,7 +623,7 @@ cleanup:
}
isccc_ccmsg_invalidate(&conn->ccmsg);
if (conn->timer != NULL) {
- isc_timer_detach(&conn->timer);
+ isc_timer_destroy(&conn->timer);
}
isc_mem_put(listener->mctx, conn, sizeof(*conn));
#ifdef ENABLE_AFL
diff --git a/external/mpl/bind/dist/bin/named/logconf.c b/external/mpl/bind/dist/bin/named/logconf.c
index 229414cdabb..f1b027d0ea9 100644
--- a/external/mpl/bind/dist/bin/named/logconf.c
+++ b/external/mpl/bind/dist/bin/named/logconf.c
@@ -1,4 +1,4 @@
-/* $NetBSD: logconf.c,v 1.7 2022/09/23 12:15:21 christos Exp $ */
+/* $NetBSD: logconf.c,v 1.8 2023/06/26 22:02:59 christos Exp $ */
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
@@ -302,10 +302,6 @@ channel_fromconf(const cfg_obj_t *channel, isc_logconfig_t *logconfig) {
dest.file.name,
isc_result_totext(result));
}
- fprintf(stderr,
- "isc_stdio_open '%s' failed: %s\n",
- dest.file.name,
- isc_result_totext(result));
} else {
(void)isc_stdio_close(fp);
}
@@ -315,8 +311,6 @@ channel_fromconf(const cfg_obj_t *channel, isc_logconfig_t *logconfig) {
syslog(LOG_ERR, "isc_file_isplainfile '%s' failed: %s",
dest.file.name, isc_result_totext(result));
}
- fprintf(stderr, "isc_file_isplainfile '%s' failed: %s\n",
- dest.file.name, isc_result_totext(result));
}
done:
diff --git a/external/mpl/bind/dist/bin/named/main.c b/external/mpl/bind/dist/bin/named/main.c
index 5aee45fed15..418a34db1f9 100644
--- a/external/mpl/bind/dist/bin/named/main.c
+++ b/external/mpl/bind/dist/bin/named/main.c
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.14 2023/01/25 21:43:23 christos Exp $ */
+/* $NetBSD: main.c,v 1.15 2023/06/26 22:02:59 christos Exp $ */
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
@@ -707,6 +707,7 @@ printversion(bool verbose) {
isc_buffer_init(&b, buf, sizeof(buf));
format_supported_algorithms(printit);
printf("\n");
+ dst_lib_destroy();
} else {
printf("DST initialization failure: %s\n",
isc_result_totext(result));
@@ -1282,6 +1283,13 @@ setup(void) {
"linked to OpenSSL version: %s",
SSLeay_version(SSLEAY_VERSION));
#endif /* OPENSSL_VERSION_NUMBER >= 0x10100000L */
+ isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
+ NAMED_LOGMODULE_MAIN, ISC_LOG_NOTICE,
+ "compiled with libuv version: %d.%d.%d", UV_VERSION_MAJOR,
+ UV_VERSION_MINOR, UV_VERSION_PATCH);
+ isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
+ NAMED_LOGMODULE_MAIN, ISC_LOG_NOTICE,
+ "linked to libuv version: %s", uv_version_string());
#ifdef HAVE_LIBXML2
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_MAIN, ISC_LOG_NOTICE,
diff --git a/external/mpl/bind/dist/bin/named/server.c b/external/mpl/bind/dist/bin/named/server.c
index 2c92bd90ea3..0f462029b0a 100644
--- a/external/mpl/bind/dist/bin/named/server.c
+++ b/external/mpl/bind/dist/bin/named/server.c
@@ -1,4 +1,4 @@
-/* $NetBSD: server.c,v 1.19 2023/01/25 21:43:23 christos Exp $ */
+/* $NetBSD: server.c,v 1.20 2023/06/26 22:02:59 christos Exp $ */
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
@@ -2673,6 +2673,7 @@ configure_rpz(dns_view_t *view, dns_view_t *pview, const cfg_obj_t **maps,
if (*old_rpz_okp) {
dns_rpz_detach_rpzs(&view->rpzs);
dns_rpz_attach_rpzs(pview->rpzs, &view->rpzs);
+ dns_rpz_detach_rpzs(&pview->rpzs);
} else if (old != NULL && pview != NULL) {
++pview->rpzs->rpz_ver;
view->rpzs->rpz_ver = pview->rpzs->rpz_ver;
@@ -3175,6 +3176,7 @@ configure_catz(dns_view_t *view, dns_view_t *pview, const cfg_obj_t *config,
if (old != NULL) {
dns_catz_catzs_detach(&view->catzs);
dns_catz_catzs_attach(pview->catzs, &view->catzs);
+ dns_catz_catzs_detach(&pview->catzs);
dns_catz_prereconfig(view->catzs);
}
@@ -3979,7 +3981,8 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
const cfg_obj_t *dyndb_list, *plugin_list;
const cfg_obj_t *disabled;
const cfg_obj_t *obj, *obj2;
- const cfg_listelt_t *element;
+ const cfg_listelt_t *element = NULL;
+ const cfg_listelt_t *zone_element_latest = NULL;
in_port_t port;
dns_cache_t *cache = NULL;
isc_result_t result;
@@ -3996,7 +3999,6 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
dns_dispatch_t *dispatch6 = NULL;
bool rpz_configured = false;
bool catz_configured = false;
- bool zones_configured = false;
bool reused_cache = false;
bool shared_cache = false;
int i = 0, j = 0, k = 0;
@@ -4100,8 +4102,8 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
CHECK(configure_zone(config, zconfig, vconfig, mctx, view,
viewlist, kasplist, actx, false,
old_rpz_ok, false));
+ zone_element_latest = element;
}
- zones_configured = true;
/*
* Check that a master or slave zone was found for each
@@ -5880,9 +5882,6 @@ cleanup:
named_config_get(maps, "catalog-zones", &obj) ==
ISC_R_SUCCESS)
{
- if (pview->catzs != NULL) {
- dns_catz_catzs_detach(&pview->catzs);
- }
/*
* We are swapping the places of the `view` and
* `pview` in the function's parameters list
@@ -5910,7 +5909,7 @@ cleanup:
dns_view_detach(&pview);
}
- if (zones_configured) {
+ if (zone_element_latest != NULL) {
for (element = cfg_list_first(zonelist);
element != NULL; element = cfg_list_next(element))
{
@@ -5918,6 +5917,13 @@ cleanup:
cfg_listelt_value(element);
configure_zone_setviewcommit(result, zconfig,
view);
+ if (element == zone_element_latest) {
+ /*
+ * This was the latest element that was
+ * successfully configured earlier.
+ */
+ break;
+ }
}
}
}
@@ -6772,6 +6778,7 @@ add_keydata_zone(dns_view_t *view, const char *directory, isc_mem_t *mctx) {
dns_zone_attach(pview->managed_keys,
&view->managed_keys);
dns_zone_setview(pview->managed_keys, view);
+ dns_zone_setviewcommit(pview->managed_keys);
dns_view_detach(&pview);
dns_zone_synckeyzone(view->managed_keys);
return (ISC_R_SUCCESS);
@@ -9291,8 +9298,8 @@ load_configuration(const char *filename, named_server_t *server,
logobj = NULL;
(void)cfg_map_get(config, "logging", &logobj);
if (logobj != NULL) {
- CHECKM(named_logconfig(logc, logobj), "configuring "
- "logging");
+ CHECKM(named_logconfig(logc, logobj),
+ "configuring logging");
} else {
named_log_setdefaultchannels(logc);
CHECKM(named_log_setunmatchedcategory(logc),
@@ -9663,6 +9670,7 @@ view_loaded(void *arg) {
if (isc_refcount_decrement(&zl->refs) == 1) {
named_server_t *server = zl->server;
bool reconfig = zl->reconfig;
+ dns_view_t *view = NULL;
isc_refcount_destroy(&zl->refs);
isc_mem_put(server->mctx, zl, sizeof(*zl));
@@ -9683,6 +9691,28 @@ view_loaded(void *arg) {
"all zones loaded");
}
+ for (view = ISC_LIST_HEAD(server->viewlist); view != NULL;
+ view = ISC_LIST_NEXT(view, link))
+ {
+ if (view->managed_keys != NULL) {
+ result = dns_zone_synckeyzone(
+ view->managed_keys);
+ if (result != ISC_R_SUCCESS) {
+ isc_log_write(
+ named_g_lctx,
+ DNS_LOGCATEGORY_DNSSEC,
+ DNS_LOGMODULE_DNSSEC,
+ ISC_LOG_ERROR,
+ "failed to initialize "
+ "managed-keys for view %s "
+ "(%s): DNSSEC validation is "
+ "at risk",
+ view->name,
+ isc_result_totext(result));
+ }
+ }
+ }
+
CHECKFATAL(dns_zonemgr_forcemaint(server->zonemgr),
"forcing zone maintenance");
@@ -9931,10 +9961,10 @@ shutdown_server(isc_task_t *task, isc_event_t *event) {
isc_mem_put(server->mctx, nsc, sizeof(*nsc));
}
- isc_timer_detach(&server->interface_timer);
- isc_timer_detach(&server->heartbeat_timer);
- isc_timer_detach(&server->pps_timer);
- isc_timer_detach(&server->tat_timer);
+ isc_timer_destroy(&server->interface_timer);
+ isc_timer_destroy(&server->heartbeat_timer);
+ isc_timer_destroy(&server->pps_timer);
+ isc_timer_destroy(&server->tat_timer);
ns_interfacemgr_detach(&server->interfacemgr);
diff --git a/external/mpl/bind/dist/bin/named/zoneconf.c b/external/mpl/bind/dist/bin/named/zoneconf.c
index d40d36221df..af8ca7763a4 100644
--- a/external/mpl/bind/dist/bin/named/zoneconf.c
+++ b/external/mpl/bind/dist/bin/named/zoneconf.c
@@ -1,4 +1,4 @@
-/* $NetBSD: zoneconf.c,v 1.13 2023/01/25 21:43:23 christos Exp $ */
+/* $NetBSD: zoneconf.c,v 1.14 2023/06/26 22:02:59 christos Exp $ */
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
@@ -927,8 +927,8 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
maps[i] = NULL;
if (vconfig != NULL) {
- RETERR(named_config_getclass(cfg_tuple_get(vconfig, "class"),
- dns_rdataclass_in, &vclass));
+ CHECK(named_config_getclass(cfg_tuple_get(vconfig, "class"),
+ dns_rdataclass_in, &vclass));
} else {
vclass = dns_rdataclass_in;
}
@@ -939,8 +939,8 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
zname = cfg_obj_asstring(cfg_tuple_get(zconfig, "name"));
- RETERR(named_config_getclass(cfg_tuple_get(zconfig, "class"), vclass,
- &zclass));
+ CHECK(named_config_getclass(cfg_tuple_get(zconfig, "class"), vclass,
+ &zclass));
dns_zone_setclass(zone, zclass);
if (raw != NULL) {
dns_zone_setclass(raw, zclass);
@@ -960,7 +960,7 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
cpval = isc_mem_strdup(mctx, cfg_obj_asstring(obj));
}
if (cpval == NULL) {
- return (ISC_R_NOMEMORY);
+ CHECK(ISC_R_NOMEMORY);
}
obj = NULL;
@@ -975,7 +975,7 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
"zone '%s': both 'database' and 'dlz' "
"specified",
zname);
- return (ISC_R_FAILURE);
+ CHECK(ISC_R_FAILURE);
}
len = strlen(dlzname) + 5;
@@ -986,7 +986,7 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
result = strtoargv(mctx, cpval, &dbargc, &dbargv);
if (result != ISC_R_SUCCESS && cpval != default_dbtype) {
isc_mem_free(mctx, cpval);
- return (result);
+ CHECK(result);
}
/*
@@ -1016,7 +1016,7 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_SERVER, ISC_LOG_ERROR,
"zone '%s': 'file' not specified", zname);
- return (ISC_R_FAILURE);
+ CHECK(ISC_R_FAILURE);
}
if (ztype == dns_zone_secondary || ztype == dns_zone_mirror) {
@@ -1054,7 +1054,7 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
"can only be used with "
"'masterfile-format text'",
zname);
- return (ISC_R_FAILURE);
+ CHECK(ISC_R_FAILURE);
}
if (strcasecmp(masterstylestr, "full") == 0) {
@@ -1079,47 +1079,45 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
size_t signedlen = strlen(filename) + sizeof(SIGNED);
char *signedname;
- RETERR(dns_zone_setfile(raw, filename, masterformat,
- masterstyle));
+ CHECK(dns_zone_setfile(raw, filename, masterformat,
+ masterstyle));
signedname = isc_mem_get(mctx, signedlen);
(void)snprintf(signedname, signedlen, "%s" SIGNED, filename);
result = dns_zone_setfile(zone, signedname,
dns_masterformat_raw, NULL);
isc_mem_put(mctx, signedname, signedlen);
- if (result != ISC_R_SUCCESS) {
- return (result);
- }
+ CHECK(result);
} else {
- RETERR(dns_zone_setfile(zone, filename, masterformat,
- masterstyle));
+ CHECK(dns_zone_setfile(zone, filename, masterformat,
+ masterstyle));
}
obj = NULL;
result = cfg_map_get(zoptions, "journal", &obj);
if (result == ISC_R_SUCCESS) {
- RETERR(dns_zone_setjournal(mayberaw, cfg_obj_asstring(obj)));
+ CHECK(dns_zone_setjournal(mayberaw, cfg_obj_asstring(obj)));
}
/*
* Notify messages are processed by the raw zone if it exists.
*/
if (ztype == dns_zone_secondary || ztype == dns_zone_mirror) {
- RETERR(configure_zone_acl(
- zconfig, vconfig, config, allow_notify, ac, mayberaw,
- dns_zone_setnotifyacl, dns_zone_clearnotifyacl));
+ CHECK(configure_zone_acl(zconfig, vconfig, config, allow_notify,
+ ac, mayberaw, dns_zone_setnotifyacl,
+ dns_zone_clearnotifyacl));
}
/*
* XXXAG This probably does not make sense for stubs.
*/
- RETERR(configure_zone_acl(zconfig, vconfig, config, allow_query, ac,
- zone, dns_zone_setqueryacl,
- dns_zone_clearqueryacl));
+ CHECK(configure_zone_acl(zconfig, vconfig, config, allow_query, ac,
+ zone, dns_zone_setqueryacl,
+ dns_zone_clearqueryacl));
- RETERR(configure_zone_acl(zconfig, vconfig, config, allow_query_on, ac,
- zone, dns_zone_setqueryonacl,
- dns_zone_clearqueryonacl));
+ CHECK(configure_zone_acl(zconfig, vconfig, config, allow_query_on, ac,
+ zone, dns_zone_setqueryonacl,
+ dns_zone_clearqueryonacl));
obj = NULL;
result = named_config_get(maps, "dialup", &obj);
@@ -1176,10 +1174,10 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
rcvquerystats = NULL;
dnssecsignstats = NULL;
if (statlevel == dns_zonestat_full) {
- RETERR(isc_stats_create(mctx, &zoneqrystats,
- ns_statscounter_max));
- RETERR(dns_rdatatypestats_create(mctx, &rcvquerystats));
- RETERR(dns_dnssecsignstats_create(mctx, &dnssecsignstats));
+ CHECK(isc_stats_create(mctx, &zoneqrystats,
+ ns_statscounter_max));
+ CHECK(dns_rdatatypestats_create(mctx, &rcvquerystats));
+ CHECK(dns_dnssecsignstats_create(mctx, &dnssecsignstats));
}
dns_zone_setrequeststats(zone, zoneqrystats);
dns_zone_setrcvquerystats(zone, rcvquerystats);
@@ -1218,7 +1216,7 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
ISC_LOG_ERROR,
"dnssec-policy '%s' not found ",
kaspname);
- RETERR(result);
+ CHECK(result);
}
dns_zone_setkasp(zone, kasp);
use_kasp = true;
@@ -1267,62 +1265,62 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
dns_ipkeylist_t ipkl;
dns_ipkeylist_init(&ipkl);
- RETERR(named_config_getipandkeylist(config, "primaries",
- obj, mctx, &ipkl));
+ CHECK(named_config_getipandkeylist(config, "primaries",
+ obj, mctx, &ipkl));
result = dns_zone_setalsonotifydscpkeys(
zone, ipkl.addrs, ipkl.dscps, ipkl.keys,
ipkl.count);
dns_ipkeylist_clear(mctx, &ipkl);
- RETERR(result);
+ CHECK(result);
} else {
- RETERR(dns_zone_setalsonotify(zone, NULL, 0));
+ CHECK(dns_zone_setalsonotify(zone, NULL, 0));
}
obj = NULL;
result = named_config_get(maps, "parental-source", &obj);
INSIST(result == ISC_R_SUCCESS && obj != NULL);
- RETERR(dns_zone_setparentalsrc4(zone, cfg_obj_assockaddr(obj)));
+ CHECK(dns_zone_setparentalsrc4(zone, cfg_obj_assockaddr(obj)));
dscp = cfg_obj_getdscp(obj);
if (dscp == -1) {
dscp = named_g_dscp;
}
- RETERR(dns_zone_setparentalsrc4dscp(zone, dscp));
+ CHECK(dns_zone_setparentalsrc4dscp(zone, dscp));
named_add_reserved_dispatch(named_g_server,
cfg_obj_assockaddr(obj));
obj = NULL;
result = named_config_get(maps, "parental-source-v6", &obj);
INSIST(result == ISC_R_SUCCESS && obj != NULL);
- RETERR(dns_zone_setparentalsrc6(zone, cfg_obj_assockaddr(obj)));
+ CHECK(dns_zone_setparentalsrc6(zone, cfg_obj_assockaddr(obj)));
dscp = cfg_obj_getdscp(obj);
if (dscp == -1) {
dscp = named_g_dscp;
}
- RETERR(dns_zone_setparentalsrc6dscp(zone, dscp));
+ CHECK(dns_zone_setparentalsrc6dscp(zone, dscp));
named_add_reserved_dispatch(named_g_server,
cfg_obj_assockaddr(obj));
obj = NULL;
result = named_config_get(maps, "notify-source", &obj);
INSIST(result == ISC_R_SUCCESS && obj != NULL);
- RETERR(dns_zone_setnotifysrc4(zone, cfg_obj_assockaddr(obj)));
+ CHECK(dns_zone_setnotifysrc4(zone, cfg_obj_assockaddr(obj)));
dscp = cfg_obj_getdscp(obj);
if (dscp == -1) {
dscp = named_g_dscp;
}
- RETERR(dns_zone_setnotifysrc4dscp(zone, dscp));
+ CHECK(dns_zone_setnotifysrc4dscp(zone, dscp));
named_add_reserved_dispatch(named_g_server,
cfg_obj_assockaddr(obj));
obj = NULL;
result = named_config_get(maps, "notify-source-v6", &obj);
INSIST(result == ISC_R_SUCCESS && obj != NULL);
- RETERR(dns_zone_setnotifysrc6(zone, cfg_obj_assockaddr(obj)));
+ CHECK(dns_zone_setnotifysrc6(zone, cfg_obj_assockaddr(obj)));
dscp = cfg_obj_getdscp(obj);
if (dscp == -1) {
dscp = named_g_dscp;
}
- RETERR(dns_zone_setnotifysrc6dscp(zone, dscp));
+ CHECK(dns_zone_setnotifysrc6dscp(zone, dscp));
named_add_reserved_dispatch(named_g_server,
cfg_obj_assockaddr(obj));
@@ -1334,7 +1332,7 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
dns_zone_setisself(zone, isself, named_g_server->interfacemgr);
- RETERR(configure_zone_acl(
+ CHECK(configure_zone_acl(
zconfig, vconfig, config, allow_transfer, ac, zone,
dns_zone_setxfracl, dns_zone_clearxfracl));
@@ -1372,7 +1370,7 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
"%" PRId64 "' "
"is too large",
value);
- RETERR(ISC_R_RANGE);
+ CHECK(ISC_R_RANGE);
}
journal_size = (uint32_t)value;
}
@@ -1512,7 +1510,7 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
"%" PRId64 "' "
"is too large",
value);
- RETERR(ISC_R_RANGE);
+ CHECK(ISC_R_RANGE);
}
journal_size = (uint32_t)value;
}
@@ -1542,9 +1540,9 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
if (ztype == dns_zone_primary) {
dns_acl_t *updateacl;
- RETERR(configure_zone_acl(
- zconfig, vconfig, config, allow_update, ac, mayberaw,
- dns_zone_setupdateacl, dns_zone_clearupdateacl));
+ CHECK(configure_zone_acl(zconfig, vconfig, config, allow_update,
+ ac, mayberaw, dns_zone_setupdateacl,
+ dns_zone_clearupdateacl));
updateacl = dns_zone_getupdateacl(mayberaw);
if (updateacl != NULL && dns_acl_isinsecure(updateacl)) {
@@ -1555,7 +1553,7 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
zname);
}
- RETERR(configure_zone_ssutable(zoptions, mayberaw, zname));
+ CHECK(configure_zone_ssutable(zoptions, mayberaw, zname));
}
/*
@@ -1632,7 +1630,7 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
result = named_config_get(maps, "key-directory", &obj);
if (result == ISC_R_SUCCESS) {
filename = cfg_obj_asstring(obj);
- RETERR(dns_zone_setkeydirectory(zone, filename));
+ CHECK(dns_zone_setkeydirectory(zone, filename));
}
obj = NULL;
@@ -1674,8 +1672,8 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
result = named_config_get(maps, "dnssec-loadkeys-interval",
&obj);
INSIST(result == ISC_R_SUCCESS && obj != NULL);
- RETERR(dns_zone_setrefreshkeyinterval(zone,
- cfg_obj_asuint32(obj)));
+ CHECK(dns_zone_setrefreshkeyinterval(zone,
+ cfg_obj_asuint32(obj)));
obj = NULL;
result = cfg_map_get(zoptions, "auto-dnssec", &obj);
@@ -1703,10 +1701,10 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
}
if (ztype == dns_zone_secondary || ztype == dns_zone_mirror) {
- RETERR(configure_zone_acl(zconfig, vconfig, config,
- allow_update_forwarding, ac, mayberaw,
- dns_zone_setforwardacl,
- dns_zone_clearforwardacl));
+ CHECK(configure_zone_acl(zconfig, vconfig, config,
+ allow_update_forwarding, ac, mayberaw,
+ dns_zone_setforwardacl,
+ dns_zone_clearforwardacl));
}
/*%
@@ -1718,14 +1716,14 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
if (obj != NULL) {
dns_ipkeylist_t ipkl;
dns_ipkeylist_init(&ipkl);
- RETERR(named_config_getipandkeylist(
+ CHECK(named_config_getipandkeylist(
config, "parental-agents", obj, mctx, &ipkl));
result = dns_zone_setparentals(zone, ipkl.addrs,
ipkl.keys, ipkl.count);
dns_ipkeylist_clear(mctx, &ipkl);
- RETERR(result);
+ CHECK(result);
} else {
- RETERR(dns_zone_setparentals(zone, NULL, NULL, 0));
+ CHECK(dns_zone_setparentals(zone, NULL, NULL, 0));
}
}
@@ -1896,7 +1894,7 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
(void)cfg_map_get(zoptions, "allow-transfer", &obj);
if (obj == NULL) {
dns_acl_t *none;
- RETERR(dns_acl_none(mctx, &none));
+ CHECK(dns_acl_none(mctx, &none));
dns_zone_setxfracl(zone, none);
dns_acl_detach(&none);
}
@@ -1921,23 +1919,23 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
result = named_config_getremotesdef(
named_g_config, "primaries",
DEFAULT_IANA_ROOT_ZONE_PRIMARIES, &obj);
- RETERR(result);
+ CHECK(result);
}
if (obj != NULL) {
dns_ipkeylist_t ipkl;
dns_ipkeylist_init(&ipkl);
- RETERR(named_config_getipandkeylist(config, "primaries",
- obj, mctx, &ipkl));
+ CHECK(named_config_getipandkeylist(config, "primaries",
+ obj, mctx, &ipkl));
result = dns_zone_setprimarieswithkeys(
mayberaw, ipkl.addrs, ipkl.keys, ipkl.count);
count = ipkl.count;
dns_ipkeylist_clear(mctx, &ipkl);
- RETERR(result);
+ CHECK(result);
} else {
result = dns_zone_setprimaries(mayberaw, NULL, 0);
}
- RETERR(result);
+ CHECK(result);
multi = false;
if (count > 1) {
@@ -1981,50 +1979,50 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
obj = NULL;
result = named_config_get(maps, "transfer-source", &obj);
INSIST(result == ISC_R_SUCCESS && obj != NULL);
- RETERR(dns_zone_setxfrsource4(mayberaw,
- cfg_obj_assockaddr(obj)));
+ CHECK(dns_zone_setxfrsource4(mayberaw,
+ cfg_obj_assockaddr(obj)));
dscp = cfg_obj_getdscp(obj);
if (dscp == -1) {
dscp = named_g_dscp;
}
- RETERR(dns_zone_setxfrsource4dscp(mayberaw, dscp));
+ CHECK(dns_zone_setxfrsource4dscp(mayberaw, dscp));
named_add_reserved_dispatch(named_g_server,
cfg_obj_assockaddr(obj));
obj = NULL;
result = named_config_get(maps, "transfer-source-v6", &obj);
INSIST(result == ISC_R_SUCCESS && obj != NULL);
- RETERR(dns_zone_setxfrsource6(mayberaw,
- cfg_obj_assockaddr(obj)));
+ CHECK(dns_zone_setxfrsource6(mayberaw,
+ cfg_obj_assockaddr(obj)));
dscp = cfg_obj_getdscp(obj);
if (dscp == -1) {
dscp = named_g_dscp;
}
- RETERR(dns_zone_setxfrsource6dscp(mayberaw, dscp));
+ CHECK(dns_zone_setxfrsource6dscp(mayberaw, dscp));
named_add_reserved_dispatch(named_g_server,
cfg_obj_assockaddr(obj));
obj = NULL;
result = named_config_get(maps, "alt-transfer-source", &obj);
INSIST(result == ISC_R_SUCCESS && obj != NULL);
- RETERR(dns_zone_setaltxfrsource4(mayberaw,
- cfg_obj_assockaddr(obj)));
+ CHECK(dns_zone_setaltxfrsource4(mayberaw,
+ cfg_obj_assockaddr(obj)));
dscp = cfg_obj_getdscp(obj);
if (dscp == -1) {
dscp = named_g_dscp;
}
- RETERR(dns_zone_setaltxfrsource4dscp(mayberaw, dscp));
+ CHECK(dns_zone_setaltxfrsource4dscp(mayberaw, dscp));
obj = NULL;
result = named_config_get(maps, "alt-transfer-source-v6", &obj);
INSIST(result == ISC_R_SUCCESS && obj != NULL);
- RETERR(dns_zone_setaltxfrsource6(mayberaw,
- cfg_obj_assockaddr(obj)));
+ CHECK(dns_zone_setaltxfrsource6(mayberaw,
+ cfg_obj_assockaddr(obj)));
dscp = cfg_obj_getdscp(obj);
if (dscp == -1) {
dscp = named_g_dscp;
}
- RETERR(dns_zone_setaltxfrsource6dscp(mayberaw, dscp));
+ CHECK(dns_zone_setaltxfrsource6dscp(mayberaw, dscp));
obj = NULL;
(void)named_config_get(maps, "use-alt-transfer-source", &obj);
@@ -2052,15 +2050,21 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
break;
case dns_zone_staticstub:
- RETERR(configure_staticstub(zoptions, zone, zname,
- default_dbtype));
+ CHECK(configure_staticstub(zoptions, zone, zname,
+ default_dbtype));
break;
default:
break;
}
- return (ISC_R_SUCCESS);
+ result = ISC_R_SUCCESS;
+
+cleanup:
+ if (kasp != NULL) {
+ dns_kasp_detach(&kasp);
+ }
+ return (result);
}
/*
diff --git a/external/mpl/bind/dist/bin/nsupdate/nsupdate.c b/external/mpl/bind/dist/bin/nsupdate/nsupdate.c
index a61d650888b..ada8c93c585 100644
--- a/external/mpl/bind/dist/bin/nsupdate/nsupdate.c
+++ b/external/mpl/bind/dist/bin/nsupdate/nsupdate.c
@@ -1,4 +1,4 @@
-/* $NetBSD: nsupdate.c,v 1.12 2023/01/25 21:43:23 christos Exp $ */
+/* $NetBSD: nsupdate.c,v 1.13 2023/06/26 22:02:59 christos Exp $ */
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
@@ -2707,8 +2707,8 @@ recvsoa(isc_task_t *task, isc_event_t *event) {
dns_request_destroy(&request);
dns_message_detach(&soaquery);
ddebug("Out of recvsoa");
- done_update();
seenerror = true;
+ done_update();
return;
}
@@ -2815,7 +2815,14 @@ lookforsoa:
master_total = get_addresses(serverstr, dnsport, master_servers,
master_alloc);
if (master_total == 0) {
- exit(1);
+ seenerror = true;
+ dns_rdata_freestruct(&soa);
+ dns_message_detach(&soaquery);
+ dns_request_destroy(&request);
+ dns_message_detach(&rcvmsg);
+ ddebug("Out of recvsoa");
+ done_update();
+ return;
}
master_inuse = 0;
} else {
diff --git a/external/mpl/bind/dist/bin/rndc/rndc.c b/external/mpl/bind/dist/bin/rndc/rndc.c
index d4bc1d6a635..5fd528e31ec 100644
--- a/external/mpl/bind/dist/bin/rndc/rndc.c
+++ b/external/mpl/bind/dist/bin/rndc/rndc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rndc.c,v 1.9 2023/01/25 21:43:24 christos Exp $ */
+/* $NetBSD: rndc.c,v 1.10 2023/06/26 22:02:59 christos Exp $ */
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
@@ -123,7 +123,7 @@ command is one of the following:\n\
Requires the zone to have a dnssec-policy.\n\
dnstap -reopen\n\
Close, truncate and re-open the DNSTAP output file.\n\
- dnstap -roll count\n\
+ dnstap -roll [count]\n\
Close, rename and re-open the DNSTAP output file(s).\n\
dumpdb [-all|-cache|-zones|-adb|-bad|-expired|-fail] [view ...]\n\
Dump cache(s) to the dump file (named_dump.db).\n\
diff --git a/external/mpl/bind/dist/bin/tests/optional/ratelimiter_test.c b/external/mpl/bind/dist/bin/tests/optional/ratelimiter_test.c
index 92f0ab0d7a1..a6928b29699 100644
--- a/external/mpl/bind/dist/bin/tests/optional/ratelimiter_test.c
+++ b/external/mpl/bind/dist/bin/tests/optional/ratelimiter_test.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ratelimiter_test.c,v 1.6 2022/09/23 12:15:23 christos Exp $ */
+/* $NetBSD: ratelimiter_test.c,v 1.7 2023/06/26 22:02:59 christos Exp $ */
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
@@ -88,7 +88,7 @@ shutdown_all(isc_task_t *task, isc_event_t *event) {
UNUSED(event);
printf("shutdown all\n");
for (i = 0; i < NEVENTS; i++) {
- isc_timer_detach(&timers[i]);
+ isc_timer_destroy(&timers[i]);
}
isc_app_shutdown();
diff --git a/external/mpl/bind/dist/bin/tests/optional/rbt_test.c b/external/mpl/bind/dist/bin/tests/optional/rbt_test.c
index 927f8447ff5..9327309a9cc 100644
--- a/external/mpl/bind/dist/bin/tests/optional/rbt_test.c
+++ b/external/mpl/bind/dist/bin/tests/optional/rbt_test.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rbt_test.c,v 1.7 2023/01/25 21:43:24 christos Exp $ */
+/* $NetBSD: rbt_test.c,v 1.8 2023/06/26 22:02:59 christos Exp $ */
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
@@ -186,8 +186,8 @@ iterate(dns_rbt_t *rbt, bool forward) {
dns_rbtnodechain_t chain;
dns_fixedname_t fixedorigin;
isc_result_t result;
- isc_result_t (*move)(dns_rbtnodechain_t * chain, dns_name_t * name,
- dns_name_t * origin);
+ isc_result_t (*move)(dns_rbtnodechain_t *chain, dns_name_t *name,
+ dns_name_t *origin);
dns_rbtnodechain_init(&chain);
diff --git a/external/mpl/bind/dist/bin/tests/optional/shutdown_test.c b/external/mpl/bind/dist/bin/tests/optional/shutdown_test.c
index 10108209f53..52fbc161246 100644
--- a/external/mpl/bind/dist/bin/tests/optional/shutdown_test.c
+++ b/external/mpl/bind/dist/bin/tests/optional/shutdown_test.c
@@ -1,4 +1,4 @@
-/* $NetBSD: shutdown_test.c,v 1.7 2022/09/23 12:15:23 christos Exp $ */
+/* $NetBSD: shutdown_test.c,v 1.8 2023/06/26 22:02:59 christos Exp $ */
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
@@ -75,7 +75,7 @@ shutdown_action(isc_task_t *task, isc_event_t *event) {
printf("task %s (%p) shutdown\n", info->name, task);
if (strcmp(info->name, "0") == 0) {
- isc_timer_detach(&info->timer);
+ isc_timer_destroy(&info->timer);
nevent = isc_event_allocate(info->mctx, info, T2_SHUTDOWNOK,
t2_shutdown, &tasks[1],
sizeof(*event));
@@ -106,7 +106,7 @@ tick(isc_task_t *task, isc_event_t *event) {
if (info->ticks == 10) {
isc_app_shutdown();
} else if (info->ticks >= 15 && info->exiting) {
- isc_timer_detach(&info->timer);
+ isc_timer_destroy(&info->timer);
isc_task_detach(&info->task);
nevent = isc_event_allocate(
info->mctx, info, T2_SHUTDOWNDONE, t1_shutdown,
@@ -116,7 +116,7 @@ tick(isc_task_t *task, isc_event_t *event) {
isc_task_detach(&info->peer);
}
} else if (strcmp(info->name, "foo") == 0) {
- isc_timer_detach(&info->timer);
+ isc_timer_destroy(&info->timer);
nevent = isc_event_allocate(info->mctx, info, FOO_EVENT,
foo_event, task, sizeof(*event));
RUNTIME_CHECK(nevent != NULL);
diff --git a/external/mpl/bind/dist/bin/tests/optional/sock_test.c b/external/mpl/bind/dist/bin/tests/optional/sock_test.c
index 6d61dc98a45..01f71244d2a 100644
--- a/external/mpl/bind/dist/bin/tests/optional/sock_test.c
+++ b/external/mpl/bind/dist/bin/tests/optional/sock_test.c
@@ -1,4 +1,4 @@
-/* $NetBSD: sock_test.c,v 1.6 2022/09/23 12:15:23 christos Exp $ */
+/* $NetBSD: sock_test.c,v 1.7 2023/06/26 22:02:59 christos Exp $ */
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
@@ -247,7 +247,7 @@ timeout(isc_task_t *task, isc_event_t *event) {
printf("Timeout, canceling IO on socket %p (task %p)\n", sock, task);
isc_socket_cancel(sock, NULL, ISC_SOCKCANCEL_ALL);
- isc_timer_detach((isc_timer_t **)&event->ev_sender);
+ isc_timer_destroy((isc_timer_t **)&event->ev_sender);
isc_event_free(&event);
}
diff --git a/external/mpl/bind/dist/bin/tests/optional/task_test.c b/external/mpl/bind/dist/bin/tests/optional/task_test.c
index 2913ff19eb8..8e509ed8405 100644
--- a/external/mpl/bind/dist/bin/tests/optional/task_test.c
+++ b/external/mpl/bind/dist/bin/tests/optional/task_test.c
@@ -1,4 +1,4 @@
-/* $NetBSD: task_test.c,v 1.6 2022/09/23 12:15:23 christos Exp $ */
+/* $NetBSD: task_test.c,v 1.7 2023/06/26 22:02:59 christos Exp $ */
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
@@ -196,8 +196,8 @@ main(int argc, char *argv[]) {
Sleep(10000);
#endif /* ifndef WIN32 */
printf("destroy\n");
- isc_timer_detach(&ti1);
- isc_timer_detach(&ti2);
+ isc_timer_destroy(&ti1);
+ isc_timer_destroy(&ti2);
isc_timermgr_destroy(&timgr);
isc_managers_destroy(&netmgr, &taskmgr);
printf("destroyed\n");
diff --git a/external/mpl/bind/dist/bin/tests/optional/timer_test.c b/external/mpl/bind/dist/bin/tests/optional/timer_test.c
index 4810006dc9f..b74ac1b05b1 100644
--- a/external/mpl/bind/dist/bin/tests/optional/timer_test.c
+++ b/external/mpl/bind/dist/bin/tests/optional/timer_test.c
@@ -1,4 +1,4 @@
-/* $NetBSD: timer_test.c,v 1.7 2022/09/23 12:15:23 christos Exp $ */
+/* $NetBSD: timer_test.c,v 1.8 2023/06/26 22:02:59 christos Exp $ */
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
@@ -166,9 +166,9 @@ main(int argc, char *argv[]) {
Sleep(15000);
#endif /* ifndef WIN32 */
printf("destroy\n");
- isc_timer_detach(&ti1);
- isc_timer_detach(&ti2);
- isc_timer_detach(&ti3);
+ isc_timer_destroy(&ti1);
+ isc_timer_destroy(&ti2);
+ isc_timer_destroy(&ti3);
#ifndef WIN32
sleep(2);
#else /* ifndef WIN32 */
diff --git a/external/mpl/bind/dist/bin/tests/system/feature-test.c b/external/mpl/bind/dist/bin/tests/system/feature-test.c
index 21a7c4f3374..19fcd80d003 100644
--- a/external/mpl/bind/dist/bin/tests/system/feature-test.c
+++ b/external/mpl/bind/dist/bin/tests/system/feature-test.c
@@ -1,4 +1,4 @@
-/* $NetBSD: feature-test.c,v 1.10 2023/01/25 21:43:24 christos Exp $ */
+/* $NetBSD: feature-test.c,v 1.11 2023/06/26 22:02:59 christos Exp $ */
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
@@ -19,6 +19,7 @@
#include <string.h>
#include <unistd.h>
+#include <isc/md.h>
#include <isc/net.h>
#include <isc/print.h>
#include <isc/util.h>
@@ -47,6 +48,7 @@ usage() {
fprintf(stderr, "\t--have-json-c\n");
fprintf(stderr, "\t--have-libxml2\n");
fprintf(stderr, "\t--ipv6only=no\n");
+ fprintf(stderr, "\t--md5\n");
fprintf(stderr, "\t--tsan\n");
fprintf(stderr, "\t--with-dlz-filesystem\n");
fprintf(stderr, "\t--with-idn\n");
@@ -176,6 +178,20 @@ main(int argc, char **argv) {
#endif /* ifdef WIN32 */
}
+ if (strcmp(argv[1], "--md5") == 0) {
+ unsigned char digest[ISC_MAX_MD_SIZE];
+ const unsigned char test[] = "test";
+ unsigned int size = sizeof(digest);
+
+ if (isc_md(ISC_MD_MD5, test, sizeof(test), digest, &size) ==
+ ISC_R_SUCCESS)
+ {
+ return (0);
+ } else {
+ return (1);
+ }
+ }
+
if (strcmp(argv[1], "--tsan") == 0) {
#if defined(__has_feature)
#if __has_feature(thread_sanitizer)
diff --git a/external/mpl/bind/dist/bin/tests/system/logfileconfig/ns1/controls.conf.in b/external/mpl/bind/dist/bin/tests/system/logfileconfig/ns1/controls.conf.in
deleted file mode 100644
index 697b02a4225..00000000000
--- a/external/mpl/bind/dist/bin/tests/system/logfileconfig/ns1/controls.conf.in
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
- *
- * SPDX-License-Identifier: MPL-2.0
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, you can obtain one at https://mozilla.org/MPL/2.0/.
- *
- * See the COPYRIGHT file distributed with this work for additional
- * information regarding copyright ownership.
- */
-
-controls {
- inet 127.0.0.1 port @CONTROLPORT@
- allow { 127.0.0.1/32; ::1/128; }
- keys { "rndc-key"; };
-};
diff --git a/external/mpl/bind/dist/bin/tests/system/logfileconfig/ns1/named.dirconf b/external/mpl/bind/dist/bin/tests/system/logfileconfig/ns1/named.dirconf
deleted file mode 100644
index 661a6fb0636..00000000000
--- a/external/mpl/bind/dist/bin/tests/system/logfileconfig/ns1/named.dirconf
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
- *
- * SPDX-License-Identifier: MPL-2.0
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, you can obtain one at https://mozilla.org/MPL/2.0/.
- *
- * See the COPYRIGHT file distributed with this work for additional
- * information regarding copyright ownership.
- */
-
-options {
- query-source address 10.53.0.1;
- notify-source 10.53.0.1;
- transfer-source 10.53.0.1;
- port @PORT@;
- pid-file "named.pid";
- listen-on { 10.53.0.1; };
- listen-on-v6 { none; };
- recursion no;
- notify yes;
-};
-
-logging {
- channel default_log {
- file "named_dir";
- print-time yes;
- };
- category default { default_log; default_debug; };
- category lame-servers { null; };
-};
-
-include "controls.conf";
-
-key "rndc-key" {
- algorithm hmac-sha256;
- secret "Am9vCg==";
-};
-
-zone "." {
- type primary;
- file "root.db";
-};
diff --git a/external/mpl/bind/dist/bin/tests/system/logfileconfig/ns1/named.iso8601 b/external/mpl/bind/dist/bin/tests/system/logfileconfig/ns1/named.iso8601
deleted file mode 100644
index 53f41cf1fb0..00000000000
--- a/external/mpl/bind/dist/bin/tests/system/logfileconfig/ns1/named.iso8601
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
- *
- * SPDX-License-Identifier: MPL-2.0
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, you can obtain one at https://mozilla.org/MPL/2.0/.
- *
- * See the COPYRIGHT file distributed with this work for additional
- * information regarding copyright ownership.
- */
-
-options {
- query-source address 10.53.0.1;
- notify-source 10.53.0.1;
- transfer-source 10.53.0.1;
- port @PORT@;
- pid-file "named.pid";
- listen-on { 10.53.0.1; };
- listen-on-v6 { none; };
- recursion no;
- notify yes;
-};
-
-logging {
- channel default_log {
- file "named_iso8601";
- print-time iso8601;
- severity debug 9;
- };
- category default { default_log; default_debug; };
-};
-
-include "controls.conf";
-
-key "rndc-key" {
- algorithm hmac-sha256;
- secret "Am9vCg==";
-};
-
-zone "." {
- type primary;
- file "root.db";
-};
diff --git a/external/mpl/bind/dist/bin/tests/system/logfileconfig/ns1/named.iso8601-utc b/external/mpl/bind/dist/bin/tests/system/logfileconfig/ns1/named.iso8601-utc
deleted file mode 100644
index 5c1a52c962e..00000000000
--- a/external/mpl/bind/dist/bin/tests/system/logfileconfig/ns1/named.iso8601-utc
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
- *
- * SPDX-License-Identifier: MPL-2.0
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, you can obtain one at https://mozilla.org/MPL/2.0/.
- *
- * See the COPYRIGHT file distributed with this work for additional
- * information regarding copyright ownership.
- */
-
-options {
- query-source address 10.53.0.1;
- notify-source 10.53.0.1;
- transfer-source 10.53.0.1;
- port @PORT@;
- pid-file "named.pid";
- listen-on { 10.53.0.1; };
- listen-on-v6 { none; };
- recursion no;
- notify yes;
-};
-
-logging {
- channel default_log {
- file "named_iso8601_utc";
- print-time iso8601-utc;
- severity debug 9;
- };
- category default { default_log; default_debug; };
-};
-
-include "controls.conf";
-
-key "rndc-key" {
- algorithm hmac-sha256;
- secret "Am9vCg==";
-};
-
-zone "." {
- type primary;
- file "root.db";
-};
diff --git a/external/mpl/bind/dist/bin/tests/system/logfileconfig/ns1/named.pipeconf b/external/mpl/bind/dist/bin/tests/system/logfileconfig/ns1/named.pipeconf
deleted file mode 100644
index f10d98ae7fa..00000000000
--- a/external/mpl/bind/dist/bin/tests/system/logfileconfig/ns1/named.pipeconf
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
- *
- * SPDX-License-Identifier: MPL-2.0
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, you can obtain one at https://mozilla.org/MPL/2.0/.
- *
- * See the COPYRIGHT file distributed with this work for additional
- * information regarding copyright ownership.
- */
-
-options {
- query-source address 10.53.0.1;
- notify-source 10.53.0.1;
- transfer-source 10.53.0.1;
- port @PORT@;
- pid-file "named.pid";
- listen-on { 10.53.0.1; };
- listen-on-v6 { none; };
- recursion no;
- notify yes;
-};
-
-logging {
- channel default_log {
- file "named_pipe";
- print-time yes;
- };
- category default { default_log; default_debug; };
- category lame-servers { null; };
-};
-
-include "controls.conf";
-
-key "rndc-key" {
- algorithm hmac-sha256;
- secret "Am9vCg==";
-};
-
-zone "." {
- type primary;
- file "root.db";
-};
diff --git a/external/mpl/bind/dist/bin/tests/system/logfileconfig/ns1/named.plain b/external/mpl/bind/dist/bin/tests/system/logfileconfig/ns1/named.plain
deleted file mode 100644
index ea651f3706e..00000000000
--- a/external/mpl/bind/dist/bin/tests/system/logfileconfig/ns1/named.plain
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
- *
- * SPDX-License-Identifier: MPL-2.0
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, you can obtain one at https://mozilla.org/MPL/2.0/.
- *
- * See the COPYRIGHT file distributed with this work for additional
- * information regarding copyright ownership.
- */
-
-options {
- query-source address 10.53.0.1;
- notify-source 10.53.0.1;
- transfer-source 10.53.0.1;
- port @PORT@;
- pid-file "named.pid";
- listen-on { 10.53.0.1; };
- listen-on-v6 { none; };
- recursion no;
- notify yes;
-};
-
-logging {
- channel default_log {
- file "named_log";
- print-time yes;
- };
- category default { default_log; default_debug; };
- category lame-servers { null; };
-
- channel query_log {
- file "query_log";
- print-time yes;
- buffered yes;
- };
- category queries { query_log; };
-};
-
-include "controls.conf";
-
-key "rndc-key" {
- algorithm hmac-sha256;
- secret "Am9vCg==";
-};
-
-
-zone "." {
- type primary;
- file "root.db";
-};
diff --git a/external/mpl/bind/dist/bin/tests/system/logfileconfig/ns1/named.plainconf b/external/mpl/bind/dist/bin/tests/system/logfileconfig/ns1/named.plainconf
deleted file mode 100644
index 2e2ee606744..00000000000
--- a/external/mpl/bind/dist/bin/tests/system/logfileconfig/ns1/named.plainconf
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
- *
- * SPDX-License-Identifier: MPL-2.0
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, you can obtain one at https://mozilla.org/MPL/2.0/.
- *
- * See the COPYRIGHT file distributed with this work for additional
- * information regarding copyright ownership.
- */
-
-options {
- query-source address 10.53.0.1;
- notify-source 10.53.0.1;
- transfer-source 10.53.0.1;
- port @PORT@;
- pid-file "named.pid";
- listen-on { 10.53.0.1; };
- listen-on-v6 { none; };
- recursion no;
- notify yes;
-};
-
-include "controls.conf";
-
-key "rndc-key" {
- algorithm hmac-sha256;
- secret "Am9vCg==";
-};
-
-zone "." {
- type primary;
- file "root.db";
-};
diff --git a/external/mpl/bind/dist/bin/tests/system/logfileconfig/ns1/named.symconf b/external/mpl/bind/dist/bin/tests/system/logfileconfig/ns1/named.symconf
deleted file mode 100644
index 304d622b854..00000000000
--- a/external/mpl/bind/dist/bin/tests/system/logfileconfig/ns1/named.symconf
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
- *
- * SPDX-License-Identifier: MPL-2.0
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, you can obtain one at https://mozilla.org/MPL/2.0/.
- *
- * See the COPYRIGHT file distributed with this work for additional
- * information regarding copyright ownership.
- */
-
-options {
- query-source address 10.53.0.1;
- notify-source 10.53.0.1;
- transfer-source 10.53.0.1;
- port @PORT@;
- pid-file "named.pid";
- listen-on { 10.53.0.1; };
- listen-on-v6 { none; };
- recursion no;
- notify yes;
-};
-
-logging {
- channel default_log {
- file "named_sym";
- print-time yes;
- };
- category default { default_log; default_debug; };
- category lame-servers { null; };
-};
-
-include "controls.conf";
-
-key "rndc-key" {
- algorithm hmac-sha256;
- secret "Am9vCg==";
-};
-
-zone "." {
- type primary;
- file "root.db";
-};
diff --git a/external/mpl/bind/dist/bin/tests/system/logfileconfig/ns1/named.tsconf b/external/mpl/bind/dist/bin/tests/system/logfileconfig/ns1/named.tsconf
deleted file mode 100644
index fe4a8d4f756..00000000000
--- a/external/mpl/bind/dist/bin/tests/system/logfileconfig/ns1/named.tsconf
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
- *
- * SPDX-License-Identifier: MPL-2.0
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, you can obtain one at https://mozilla.org/MPL/2.0/.
- *
- * See the COPYRIGHT file distributed with this work for additional
- * information regarding copyright ownership.
- */
-
-options {
- query-source address 10.53.0.1;
- notify-source 10.53.0.1;
- transfer-source 10.53.0.1;
- port @PORT@;
- pid-file "named.pid";
- listen-on { 10.53.0.1; };
- listen-on-v6 { none; };
- recursion no;
- notify yes;
-};
-
-logging {
- channel default_log {
- buffered no;
- file "named_ts" versions 10 size 1000 suffix timestamp; # small size
- severity debug 100;
- print-time yes;
- };
- category default { default_log; default_debug; };
- category lame-servers { null; };
-
- channel query_log {
- file "query_log";
- print-time yes;
- buffered yes;
- };
- category queries { query_log; };
-};
-
-include "controls.conf";
-
-key "rndc-key" {
- algorithm hmac-sha256;
- secret "Am9vCg==";
-};
-
-
-zone "." {
- type primary;
- file "root.db";
-};
diff --git a/external/mpl/bind/dist/bin/tests/system/logfileconfig/ns1/named.unlimited b/external/mpl/bind/dist/bin/tests/system/logfileconfig/ns1/named.unlimited
deleted file mode 100644
index 54041da0747..00000000000
--- a/external/mpl/bind/dist/bin/tests/system/logfileconfig/ns1/named.unlimited
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
- *
- * SPDX-License-Identifier: MPL-2.0
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, you can obtain one at https://mozilla.org/MPL/2.0/.
- *
- * See the COPYRIGHT file distributed with this work for additional
- * information regarding copyright ownership.
- */
-
-options {
- query-source address 10.53.0.1;
- notify-source 10.53.0.1;
- transfer-source 10.53.0.1;
- port @PORT@;
- pid-file "named.pid";
- listen-on { 10.53.0.1; };
- listen-on-v6 { none; };
- recursion no;
- notify yes;
-};
-
-logging {
- channel default_log {
- buffered no;
- file "named_unlimited" versions unlimited size 1000;
- severity debug 100;
- print-time yes;
- };
- category default { default_log; default_debug; };
- category lame-servers { null; };
-
- channel query_log {
- file "query_log";
- print-time yes;
- buffered yes;
- };
- category queries { query_log; };
-};
-
-include "controls.conf";
-
-key "rndc-key" {
- algorithm hmac-sha256;
- secret "Am9vCg==";
-};
-
-
-zone "." {
- type primary;
- file "root.db";
-};
diff --git a/external/mpl/bind/dist/bin/tests/system/logfileconfig/ns1/named.versconf b/external/mpl/bind/dist/bin/tests/system/logfileconfig/ns1/named.versconf
deleted file mode 100644
index 3cbd16522cf..00000000000
--- a/external/mpl/bind/dist/bin/tests/system/logfileconfig/ns1/named.versconf
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
- *
- * SPDX-License-Identifier: MPL-2.0
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, you can obtain one at https://mozilla.org/MPL/2.0/.
- *
- * See the COPYRIGHT file distributed with this work for additional
- * information regarding copyright ownership.
- */
-
-options {
- query-source address 10.53.0.1;
- notify-source 10.53.0.1;
- transfer-source 10.53.0.1;
- port @PORT@;
- pid-file "named.pid";
- listen-on { 10.53.0.1; };
- listen-on-v6 { none; };
- recursion no;
- notify yes;
-};
-
-logging {
- channel default_log {
- buffered no;
- file "named_vers" versions 5 size 1000; // really small size
- severity debug 100;
- print-time yes;
- };
- category default { default_log; default_debug; };
- category lame-servers { null; };
-
- channel query_log {
- file "query_log";
- print-time yes;
- buffered yes;
- };
- category queries { query_log; };
-};
-
-include "controls.conf";
-
-key "rndc-key" {
- algorithm hmac-sha256;
- secret "Am9vCg==";
-};
-
-
-zone "." {
- type primary;
- file "root.db";
-};
diff --git a/external/mpl/bind/dist/bin/tests/system/logfileconfig/ns1/rndc.conf.in b/external/mpl/bind/dist/bin/tests/system/logfileconfig/ns1/rndc.conf.in
deleted file mode 100644
index 4bd9af7b061..00000000000
--- a/external/mpl/bind/dist/bin/tests/system/logfileconfig/ns1/rndc.conf.in
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
- *
- * SPDX-License-Identifier: MPL-2.0
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, you can obtain one at https://mozilla.org/MPL/2.0/.
- *
- * See the COPYRIGHT file distributed with this work for additional
- * information regarding copyright ownership.
- */
-
-options {
- default-server 127.0.0.1;
-};
-
-server 127.0.0.1 {
- key "rndc-key";
- addresses { 127.0.0.1 port @CONTROLPORT@; };
-};
-
-key "rndc-key" {
- algorithm hmac-sha256;
- secret "Am9vCg==";
-};
diff --git a/external/mpl/bind/dist/bin/tests/system/logfileconfig/ns1/root.db b/external/mpl/bind/dist/bin/tests/system/logfileconfig/ns1/root.db
deleted file mode 100644
index 58a675c63e0..00000000000
--- a/external/mpl/bind/dist/bin/tests/system/logfileconfig/ns1/root.db
+++ /dev/null
@@ -1,27 +0,0 @@
-; Copyright (C) Internet Systems Consortium, Inc. ("ISC")
-;
-; SPDX-License-Identifier: MPL-2.0
-;
-; This Source Code Form is subject to the terms of the Mozilla Public
-; License, v. 2.0. If a copy of the MPL was not distributed with this
-; file, you can obtain one at https://mozilla.org/MPL/2.0/.
-;
-; See the COPYRIGHT file distributed with this work for additional
-; information regarding copyright ownership.
-
-$TTL 300
-. IN SOA gson.nominum.com. a.root.servers.nil. (
- 2000042100 ; serial
- 600 ; refresh
- 600 ; retry
- 1200 ; expire
- 600 ; minimum
- )
-. NS a.root-servers.nil.
-a.root-servers.nil. A 10.53.0.1
-
-example. NS ns2.example.
-ns2.example. A 10.53.0.2
-
-tsigzone. NS ns2.tsigzone.
-ns2.tsigzone. A 10.53.0.2
diff --git a/external/mpl/bind/dist/bin/tests/system/ttl/tests.sh b/external/mpl/bind/dist/bin/tests/system/ttl/tests.sh
deleted file mode 100644
index ea32c1b0b9c..00000000000
--- a/external/mpl/bind/dist/bin/tests/system/ttl/tests.sh
+++ /dev/null
@@ -1,46 +0,0 @@
-#!/bin/sh
-
-# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
-#
-# SPDX-License-Identifier: MPL-2.0
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, you can obtain one at https://mozilla.org/MPL/2.0/.
-#
-# See the COPYRIGHT file distributed with this work for additional
-# information regarding copyright ownership.
-
-. $SYSTEMTESTTOP/conf.sh
-
-dig_with_options() { "$DIG" +noadd +nosea +nostat +noquest +nocomm +nocmd -p "${PORT}" "$@"; }
-
-status=0
-t=0
-
-echo_i "testing min-cache-ttl"
-t=$((t+1))
-dig_with_options IN SOA min-example. @10.53.0.2 > dig.out.${t}
-TTL=$(< dig.out.${t} awk '{ print $2; }')
-[ "$TTL" -eq 60 ] || status=$((status+1))
-
-echo_i "testing min-ncache-ttl"
-t=$((t+1))
-dig_with_options IN MX min-example. @10.53.0.2 > dig.out.${t}
-TTL=$(< dig.out.${t} awk '{ print $2; }')
-[ "$TTL" -eq 30 ] || status=$((status+1))
-
-echo_i "testing max-cache-ttl"
-t=$((t+1))
-dig_with_options IN SOA max-example. @10.53.0.2 > dig.out.${t}
-TTL=$(< dig.out.${t} awk '{ print $2; }')
-[ "$TTL" -eq 120 ] || status=$((status+1))
-
-echo_i "testing max-ncache-ttl"
-t=$((t+1))
-dig_with_options IN MX max-example. @10.53.0.2 > dig.out.${t}
-TTL=$(< dig.out.${t} awk '{ print $2; }')
-[ "$TTL" -eq 60 ] || status=$((status+1))
-
-echo_i "exit status: $status"
-[ $status -eq 0 ] || exit 1
diff --git a/external/mpl/bind/dist/configure b/external/mpl/bind/dist/configure
index 9113596b8fa..1b436d63ebe 100755
--- a/external/mpl/bind/dist/configure
+++ b/external/mpl/bind/dist/configure
@@ -686,6 +686,7 @@ PDFTARGET
HTMLTARGET
PDFLATEX
RELEASE_DATE
+BUILD_MANPAGES
HAVE_XELATEX_FALSE
HAVE_XELATEX_TRUE
LATEXMK
@@ -16140,23 +16141,21 @@ done
# libuv
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuv" >&5
-$as_echo_n "checking for libuv... " >&6; }
pkg_failed=no
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuv >= 1.0.0" >&5
-$as_echo_n "checking for libuv >= 1.0.0... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuv >= 1.37.0" >&5
+printf %s "checking for libuv >= 1.37.0... " >&6; }
if test -n "$LIBUV_CFLAGS"; then
pkg_cv_LIBUV_CFLAGS="$LIBUV_CFLAGS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libuv >= 1.0.0\""; } >&5
- ($PKG_CONFIG --exists --print-errors "libuv >= 1.0.0") 2>&5
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libuv >= 1.37.0\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "libuv >= 1.37.0") 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
- pkg_cv_LIBUV_CFLAGS=`$PKG_CONFIG --cflags "libuv >= 1.0.0" 2>/dev/null`
+ pkg_cv_LIBUV_CFLAGS=`$PKG_CONFIG --cflags "libuv >= 1.37.0" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
@@ -16168,12 +16167,12 @@ if test -n "$LIBUV_LIBS"; then
pkg_cv_LIBUV_LIBS="$LIBUV_LIBS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libuv >= 1.0.0\""; } >&5
- ($PKG_CONFIG --exists --print-errors "libuv >= 1.0.0") 2>&5
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libuv >= 1.37.0\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "libuv >= 1.37.0") 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
- pkg_cv_LIBUV_LIBS=`$PKG_CONFIG --libs "libuv >= 1.0.0" 2>/dev/null`
+ pkg_cv_LIBUV_LIBS=`$PKG_CONFIG --libs "libuv >= 1.37.0" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
@@ -16185,8 +16184,67 @@ fi
if test $pkg_failed = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi
+ if test $_pkg_short_errors_supported = yes; then
+ LIBUV_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libuv >= 1.37.0" 2>&1`
+ else
+ LIBUV_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libuv >= 1.37.0" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$LIBUV_PKG_ERRORS" >&5
+
+
+pkg_failed=no
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuv >= 1.0.0 libuv < 1.35.0" >&5
+printf %s "checking for libuv >= 1.0.0 libuv < 1.35.0... " >&6; }
+
+if test -n "$LIBUV_CFLAGS"; then
+ pkg_cv_LIBUV_CFLAGS="$LIBUV_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libuv >= 1.0.0 libuv < 1.35.0\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "libuv >= 1.0.0 libuv < 1.35.0") 2>&5
+ ac_status=$?
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_LIBUV_CFLAGS=`$PKG_CONFIG --cflags "libuv >= 1.0.0 libuv < 1.35.0" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+if test -n "$LIBUV_LIBS"; then
+ pkg_cv_LIBUV_LIBS="$LIBUV_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libuv >= 1.0.0 libuv < 1.35.0\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "libuv >= 1.0.0 libuv < 1.35.0") 2>&5
+ ac_status=$?
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_LIBUV_LIBS=`$PKG_CONFIG --libs "libuv >= 1.0.0 libuv < 1.35.0" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
_pkg_short_errors_supported=yes
@@ -16194,23 +16252,104 @@ else
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
- LIBUV_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libuv >= 1.0.0" 2>&1`
+ LIBUV_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libuv >= 1.0.0 libuv < 1.35.0" 2>&1`
else
- LIBUV_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libuv >= 1.0.0" 2>&1`
+ LIBUV_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libuv >= 1.0.0 libuv < 1.35.0" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$LIBUV_PKG_ERRORS" >&5
- as_fn_error $? "libuv not found" "$LINENO" 5
+ as_fn_error $? "libuv >= 1.0.0 (except 1.35.0 and 1.36.0) not found" "$LINENO" 5
elif test $pkg_failed = untried; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- as_fn_error $? "libuv not found" "$LINENO" 5
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+ as_fn_error $? "libuv >= 1.0.0 (except 1.35.0 and 1.36.0) not found" "$LINENO" 5
else
LIBUV_CFLAGS=$pkg_cv_LIBUV_CFLAGS
LIBUV_LIBS=$pkg_cv_LIBUV_LIBS
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+printf "%s\n" "yes" >&6; }
+
+fi
+elif test $pkg_failed = untried; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+
+pkg_failed=no
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuv >= 1.0.0 libuv < 1.35.0" >&5
+printf %s "checking for libuv >= 1.0.0 libuv < 1.35.0... " >&6; }
+
+if test -n "$LIBUV_CFLAGS"; then
+ pkg_cv_LIBUV_CFLAGS="$LIBUV_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libuv >= 1.0.0 libuv < 1.35.0\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "libuv >= 1.0.0 libuv < 1.35.0") 2>&5
+ ac_status=$?
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_LIBUV_CFLAGS=`$PKG_CONFIG --cflags "libuv >= 1.0.0 libuv < 1.35.0" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+if test -n "$LIBUV_LIBS"; then
+ pkg_cv_LIBUV_LIBS="$LIBUV_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libuv >= 1.0.0 libuv < 1.35.0\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "libuv >= 1.0.0 libuv < 1.35.0") 2>&5
+ ac_status=$?
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_LIBUV_LIBS=`$PKG_CONFIG --libs "libuv >= 1.0.0 libuv < 1.35.0" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi
+ if test $_pkg_short_errors_supported = yes; then
+ LIBUV_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libuv >= 1.0.0 libuv < 1.35.0" 2>&1`
+ else
+ LIBUV_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libuv >= 1.0.0 libuv < 1.35.0" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$LIBUV_PKG_ERRORS" >&5
+
+ as_fn_error $? "libuv >= 1.0.0 (except 1.35.0 and 1.36.0) not found" "$LINENO" 5
+elif test $pkg_failed = untried; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+ as_fn_error $? "libuv >= 1.0.0 (except 1.35.0 and 1.36.0) not found" "$LINENO" 5
+else
+ LIBUV_CFLAGS=$pkg_cv_LIBUV_CFLAGS
+ LIBUV_LIBS=$pkg_cv_LIBUV_LIBS
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+printf "%s\n" "yes" >&6; }
+
+fi
+else
+ LIBUV_CFLAGS=$pkg_cv_LIBUV_CFLAGS
+ LIBUV_LIBS=$pkg_cv_LIBUV_LIBS
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+printf "%s\n" "yes" >&6; }
fi
@@ -17511,7 +17650,12 @@ PKCS11_MANS=
#
# was --enable-native-pkcs11 specified?
#
-# [pairwise: --enable-native-pkcs11 --with-dlopen, --disable-native-pkcs11 --with-dlopen, --disable-native-pkcs11 --without-dlopen]
+# DNSRPS builds are included in pairwise testing here and not later because both
+# --enable-native-pkcs11 and --enable-dnsrps-dl require --with-dlopen and the
+# ordering of the set of ./configure arguments generated during pairwise testing
+# is random.
+#
+# [pairwise: --enable-native-pkcs11 --enable-dnsrps --enable-dnsrps-dl --with-dlopen, --disable-native-pkcs11 --enable-dnsrps --enable-dnsrps-dl --with-dlopen, --disable-native-pkcs11 --enable-dnsrps --enable-dnsrps-dl --with-dlopen, --disable-native-pkcs11 --disable-dnsrps --without-dlopen]
# Check whether --enable-native-pkcs11 was given.
if test "${enable_native_pkcs11+set}" = set; then :
enableval=$enable_native_pkcs11; :
@@ -21462,6 +21606,16 @@ fi
#
+# Build the man pages only if we have prebuilt manpages or we can build them from RST sources
+#
+BUILD_MANPAGES=
+if test -e doc/man/named.conf.5in || test "$SPHINX_BUILD" != ":"
+then :
+ BUILD_MANPAGES=man
+fi
+
+
+#
# Pull release date from CHANGES file last modification date
# for reproducible builds
#
@@ -22935,8 +23089,9 @@ $as_echo "no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-# DNSRPS is not included in pairwise testing as the librpz library is not
-# present in the relevant Docker image.
+# DNSRPS builds are included in pairwise testing along --enable-native-pkcs11
+# tests above as both of these features require --with-dlopen (see also the
+# relevant comment there).
#
# [pairwise: skip]
# Check whether --enable-dnsrps-dl was given.
diff --git a/external/mpl/bind/dist/doc/man/named-compilezone.1in b/external/mpl/bind/dist/doc/man/named-compilezone.1in
deleted file mode 100644
index 7635bd07add..00000000000
--- a/external/mpl/bind/dist/doc/man/named-compilezone.1in
+++ /dev/null
@@ -1,206 +0,0 @@
-.\" Man page generated from reStructuredText.
-.
-.
-.nr rst2man-indent-level 0
-.
-.de1 rstReportMargin
-\\$1 \\n[an-margin]
-level \\n[rst2man-indent-level]
-level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
--
-\\n[rst2man-indent0]
-\\n[rst2man-indent1]
-\\n[rst2man-indent2]
-..
-.de1 INDENT
-.\" .rstReportMargin pre:
-. RS \\$1
-. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
-. nr rst2man-indent-level +1
-.\" .rstReportMargin post:
-..
-.de UNINDENT
-. RE
-.\" indent \\n[an-margin]
-.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
-.nr rst2man-indent-level -1
-.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
-.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
-..
-.TH "NAMED-COMPILEZONE" "1" "@RELEASE_DATE@" "@PACKAGE_VERSION@" "BIND 9"
-.SH NAME
-named-compilezone \- zone file validity checking or converting tool
-.SH SYNOPSIS
-.sp
-\fBnamed\-compilezone\fP [\fB\-d\fP] [\fB\-h\fP] [\fB\-j\fP] [\fB\-q\fP] [\fB\-v\fP] [\fB\-c\fP class] [\fB\-f\fP format] [\fB\-F\fP format] [\fB\-J\fP filename] [\fB\-i\fP mode] [\fB\-k\fP mode] [\fB\-m\fP mode] [\fB\-M\fP mode] [\fB\-n\fP mode] [\fB\-l\fP ttl] [\fB\-L\fP serial] [\fB\-r\fP mode] [\fB\-s\fP style] [\fB\-S\fP mode] [\fB\-t\fP directory] [\fB\-T\fP mode] [\fB\-w\fP directory] [\fB\-D\fP] [\fB\-W\fP mode] {\fB\-o\fP filename} {zonename} {filename}
-.SH DESCRIPTION
-.sp
-\fBnamed\-compilezone\fP checks the syntax and integrity of a zone file,
-and dumps the zone contents to a specified file in a specified format.
-It applies strict check levels by default, since the
-dump output is used as an actual zone file loaded by \fBnamed\fP\&.
-When manually specified otherwise, the check levels must at least be as
-strict as those specified in the \fBnamed\fP configuration file.
-.SH OPTIONS
-.INDENT 0.0
-.TP
-.B \fB\-d\fP
-This option enables debugging.
-.TP
-.B \fB\-h\fP
-This option prints the usage summary and exits.
-.TP
-.B \fB\-q\fP
-This option sets quiet mode, which only sets an exit code to indicate
-successful or failed completion.
-.TP
-.B \fB\-v\fP
-This option prints the version of the \fBnamed\-checkzone\fP program and exits.
-.TP
-.B \fB\-j\fP
-When loading a zone file, this option tells \fBnamed\fP to read the journal if it exists. The journal
-file name is assumed to be the zone file name with the
-string \fB\&.jnl\fP appended.
-.TP
-.B \fB\-J filename\fP
-When loading the zone file, this option tells \fBnamed\fP to read the journal from the given file, if
-it exists. This implies \fB\-j\fP\&.
-.TP
-.B \fB\-c class\fP
-This option specifies the class of the zone. If not specified, \fBIN\fP is assumed.
-.TP
-.B \fB\-i mode\fP
-This option performs post\-load zone integrity checks. Possible modes are
-\fBfull\fP (the default), \fBfull\-sibling\fP, \fBlocal\fP,
-\fBlocal\-sibling\fP, and \fBnone\fP\&.
-.sp
-Mode \fBfull\fP checks that MX records refer to A or AAAA records
-(both in\-zone and out\-of\-zone hostnames). Mode \fBlocal\fP only
-checks MX records which refer to in\-zone hostnames.
-.sp
-Mode \fBfull\fP checks that SRV records refer to A or AAAA records
-(both in\-zone and out\-of\-zone hostnames). Mode \fBlocal\fP only
-checks SRV records which refer to in\-zone hostnames.
-.sp
-Mode \fBfull\fP checks that delegation NS records refer to A or AAAA
-records (both in\-zone and out\-of\-zone hostnames). It also checks that
-glue address records in the zone match those advertised by the child.
-Mode \fBlocal\fP only checks NS records which refer to in\-zone
-hostnames or verifies that some required glue exists, i.e., when the
-name server is in a child zone.
-.sp
-Modes \fBfull\-sibling\fP and \fBlocal\-sibling\fP disable sibling glue
-checks, but are otherwise the same as \fBfull\fP and \fBlocal\fP,
-respectively.
-.sp
-Mode \fBnone\fP disables the checks.
-.TP
-.B \fB\-f format\fP
-This option specifies the format of the zone file. Possible formats are
-\fBtext\fP (the default), and \fBraw\fP\&.
-.TP
-.B \fB\-F format\fP
-This option specifies the format of the output file specified. For
-\fBnamed\-checkzone\fP, this does not have any effect unless it dumps
-the zone contents.
-.sp
-Possible formats are \fBtext\fP (the default), which is the standard
-textual representation of the zone, and \fBraw\fP and \fBraw=N\fP, which
-store the zone in a binary format for rapid loading by \fBnamed\fP\&.
-\fBraw=N\fP specifies the format version of the raw zone file: if \fBN\fP is
-0, the raw file can be read by any version of \fBnamed\fP; if N is 1, the
-file can only be read by release 9.9.0 or higher. The default is 1.
-.TP
-.B \fB\-k mode\fP
-This option performs \fBcheck\-names\fP checks with the specified failure mode.
-Possible modes are \fBfail\fP (the default), \fBwarn\fP, and \fBignore\fP\&.
-.TP
-.B \fB\-l ttl\fP
-This option sets a maximum permissible TTL for the input file. Any record with a
-TTL higher than this value causes the zone to be rejected. This
-is similar to using the \fBmax\-zone\-ttl\fP option in \fBnamed.conf\fP\&.
-.TP
-.B \fB\-L serial\fP
-When compiling a zone to \fBraw\fP format, this option sets the "source
-serial" value in the header to the specified serial number. This is
-expected to be used primarily for testing purposes.
-.TP
-.B \fB\-m mode\fP
-This option specifies whether MX records should be checked to see if they are
-addresses. Possible modes are \fBfail\fP, \fBwarn\fP (the default), and
-\fBignore\fP\&.
-.TP
-.B \fB\-M mode\fP
-This option checks whether a MX record refers to a CNAME. Possible modes are
-\fBfail\fP, \fBwarn\fP (the default), and \fBignore\fP\&.
-.TP
-.B \fB\-n mode\fP
-This option specifies whether NS records should be checked to see if they are
-addresses. Possible modes are \fBfail\fP (the default), \fBwarn\fP, and
-\fBignore\fP\&.
-.TP
-.B \fB\-o filename\fP
-This option writes the zone output to \fBfilename\fP\&. If \fBfilename\fP is \fB\-\fP, then
-the zone output is written to standard output. This is mandatory for \fBnamed\-compilezone\fP\&.
-.TP
-.B \fB\-r mode\fP
-This option checks for records that are treated as different by DNSSEC but are
-semantically equal in plain DNS. Possible modes are \fBfail\fP,
-\fBwarn\fP (the default), and \fBignore\fP\&.
-.TP
-.B \fB\-s style\fP
-This option specifies the style of the dumped zone file. Possible styles are
-\fBfull\fP (the default) and \fBrelative\fP\&. The \fBfull\fP format is most
-suitable for processing automatically by a separate script.
-The relative format is more human\-readable and is thus
-suitable for editing by hand.
-.TP
-.B \fB\-S mode\fP
-This option checks whether an SRV record refers to a CNAME. Possible modes are
-\fBfail\fP, \fBwarn\fP (the default), and \fBignore\fP\&.
-.TP
-.B \fB\-t directory\fP
-This option tells \fBnamed\fP to chroot to \fBdirectory\fP, so that \fBinclude\fP directives in the
-configuration file are processed as if run by a similarly chrooted
-\fBnamed\fP\&.
-.TP
-.B \fB\-T mode\fP
-This option checks whether Sender Policy Framework (SPF) records exist and issues a
-warning if an SPF\-formatted TXT record is not also present. Possible
-modes are \fBwarn\fP (the default) and \fBignore\fP\&.
-.TP
-.B \fB\-w directory\fP
-This option instructs \fBnamed\fP to chdir to \fBdirectory\fP, so that relative filenames in master file
-\fB$INCLUDE\fP directives work. This is similar to the directory clause in
-\fBnamed.conf\fP\&.
-.TP
-.B \fB\-D\fP
-This option dumps the zone file in canonical format. This is always enabled for
-\fBnamed\-compilezone\fP\&.
-.TP
-.B \fB\-W mode\fP
-This option specifies whether to check for non\-terminal wildcards. Non\-terminal
-wildcards are almost always the result of a failure to understand the
-wildcard matching algorithm (\fI\%RFC 4592\fP). Possible modes are \fBwarn\fP
-(the default) and \fBignore\fP\&.
-.TP
-.B \fBzonename\fP
-This indicates the domain name of the zone being checked.
-.TP
-.B \fBfilename\fP
-This is the name of the zone file.
-.UNINDENT
-.SH RETURN VALUES
-.sp
-\fBnamed\-compilezone\fP returns an exit status of 1 if errors were detected
-and 0 otherwise.
-.SH SEE ALSO
-.sp
-\fBnamed(8)\fP, \fBnamed\-checkconf(8)\fP, \fBnamed\-checkzone(8)\fP,
-\fI\%RFC 1035\fP, BIND 9 Administrator Reference Manual.
-.SH AUTHOR
-Internet Systems Consortium
-.SH COPYRIGHT
-2022, Internet Systems Consortium
-.\" Generated by docutils manpage writer.
-.
diff --git a/external/mpl/bind/dist/fuzz/fuzz.h b/external/mpl/bind/dist/fuzz/fuzz.h
index 1594e4f2fd4..aa77a298975 100644
--- a/external/mpl/bind/dist/fuzz/fuzz.h
+++ b/external/mpl/bind/dist/fuzz/fuzz.h
@@ -1,4 +1,4 @@
-/* $NetBSD: fuzz.h,v 1.5 2022/09/23 12:15:29 christos Exp $ */
+/* $NetBSD: fuzz.h,v 1.6 2023/06/26 22:03:00 christos Exp $ */
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
@@ -32,16 +32,4 @@ extern bool debug;
int
LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);
-static isc_mem_t *mctx = NULL;
-
-static void __attribute__((constructor)) init(void) {
- isc_mem_create(&mctx);
- RUNTIME_CHECK(dst_lib_init(mctx, NULL) == ISC_R_SUCCESS);
-}
-
-static void __attribute__((destructor)) deinit(void) {
- dst_lib_destroy();
- isc_mem_destroy(&mctx);
-}
-
ISC_LANG_ENDDECLS
diff --git a/external/mpl/bind/dist/lib/dns/catz.c b/external/mpl/bind/dist/lib/dns/catz.c
index 76f0c99d0a5..67746e4be06 100644
--- a/external/mpl/bind/dist/lib/dns/catz.c
+++ b/external/mpl/bind/dist/lib/dns/catz.c
@@ -1,4 +1,4 @@
-/* $NetBSD: catz.c,v 1.9 2023/01/25 21:43:30 christos Exp $ */
+/* $NetBSD: catz.c,v 1.10 2023/06/26 22:03:00 christos Exp $ */
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
@@ -632,7 +632,7 @@ cleanup_ht:
isc_ht_destroy(&new_zones->zones);
isc_refcount_destroy(&new_zones->refs);
isc_mutex_destroy(&new_zones->lock);
- isc_mem_put(mctx, new_zones, sizeof(*new_zones));
+ isc_mem_putanddetach(&new_zones->mctx, new_zones, sizeof(*new_zones));
return (result);
}
@@ -754,8 +754,10 @@ dns_catz_get_zone(dns_catz_zones_t *catzs, const dns_name_t *name) {
REQUIRE(DNS_CATZ_ZONES_VALID(catzs));
REQUIRE(ISC_MAGIC_VALID(name, DNS_NAME_MAGIC));
+ LOCK(&catzs->lock);
result = isc_ht_find(catzs->zones, name->ndata, name->length,
(void **)&found);
+ UNLOCK(&catzs->lock);
if (result != ISC_R_SUCCESS) {
return (NULL);
}
@@ -810,7 +812,7 @@ dns_catz_zone_detach(dns_catz_zone_t **zonep) {
isc_ht_destroy(&zone->entries);
}
zone->magic = 0;
- isc_timer_detach(&zone->updatetimer);
+ isc_timer_destroy(&zone->updatetimer);
if (zone->db_registered) {
dns_db_updatenotify_unregister(
zone->db, dns_catz_dbupdate_callback,
@@ -1763,6 +1765,8 @@ dns_catz_dbupdate_callback(dns_db_t *db, void *fn_arg) {
if (zone->dbversion != NULL) {
dns_db_closeversion(zone->db, &zone->dbversion, false);
}
+ dns_db_updatenotify_unregister(
+ zone->db, dns_catz_dbupdate_callback, zone->catzs);
dns_db_detach(&zone->db);
/*
* We're not registering db update callback, it will be
@@ -1860,6 +1864,14 @@ dns_catz_update_from_db(dns_db_t *db, dns_catz_zones_t *catzs) {
return;
}
+ if (!oldzone->active) {
+ /* This can happen during a reconfiguration. */
+ isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL,
+ DNS_LOGMODULE_MASTER, ISC_LOG_INFO,
+ "catz: zone '%s' is no longer active", bname);
+ return;
+ }
+
isc_buffer_init(&ibname, bname, DNS_NAME_FORMATSIZE);
result = dns_name_totext(&db->origin, true, &ibname);
INSIST(result == ISC_R_SUCCESS);
@@ -2028,6 +2040,7 @@ dns_catz_prereconfig(dns_catz_zones_t *catzs) {
REQUIRE(DNS_CATZ_ZONES_VALID(catzs));
+ LOCK(&catzs->lock);
isc_ht_iter_create(catzs->zones, &iter);
for (result = isc_ht_iter_first(iter); result == ISC_R_SUCCESS;
result = isc_ht_iter_next(iter))
@@ -2036,6 +2049,7 @@ dns_catz_prereconfig(dns_catz_zones_t *catzs) {
isc_ht_iter_current(iter, (void **)&zone);
zone->active = false;
}
+ UNLOCK(&catzs->lock);
INSIST(result == ISC_R_NOMORE);
isc_ht_iter_destroy(&iter);
}
diff --git a/external/mpl/bind/dist/lib/dns/dnsrps.c b/external/mpl/bind/dist/lib/dns/dnsrps.c
index 92d9efbd83f..422ce8cf4c7 100644
--- a/external/mpl/bind/dist/lib/dns/dnsrps.c
+++ b/external/mpl/bind/dist/lib/dns/dnsrps.c
@@ -1,4 +1,4 @@
-/* $NetBSD: dnsrps.c,v 1.9 2023/01/25 21:43:30 christos Exp $ */
+/* $NetBSD: dnsrps.c,v 1.10 2023/06/26 22:03:00 christos Exp $ */
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
@@ -640,6 +640,7 @@ rpsdb_allrdatasets(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version,
rpsdb_iter->common.magic = DNS_RDATASETITER_MAGIC;
rpsdb_iter->common.methods = &rpsdb_rdatasetiter_methods;
rpsdb_iter->common.db = db;
+ rpsdb_iter->common.options = options;
rpsdb_attachnode(db, node, &rpsdb_iter->common.node);
*iteratorp = &rpsdb_iter->common;
diff --git a/external/mpl/bind/dist/lib/dns/hmac_link.c b/external/mpl/bind/dist/lib/dns/hmac_link.c
index 3bc50458752..c96de03bad9 100644
--- a/external/mpl/bind/dist/lib/dns/hmac_link.c
+++ b/external/mpl/bind/dist/lib/dns/hmac_link.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hmac_link.c,v 1.7 2023/01/25 21:43:30 christos Exp $ */
+/* $NetBSD: hmac_link.c,v 1.8 2023/06/26 22:03:00 christos Exp $ */
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
@@ -172,6 +172,7 @@ hmac_createctx(const isc_md_type_t *type, const dst_key_t *key,
result = isc_hmac_init(ctx, hkey->key, isc_md_type_get_block_size(type),
type);
if (result != ISC_R_SUCCESS) {
+ isc_hmac_free(ctx);
return (DST_R_UNSUPPORTEDALG);
}
diff --git a/external/mpl/bind/dist/lib/dns/include/dns/view.h b/external/mpl/bind/dist/lib/dns/include/dns/view.h
index b0d6fd6554c..d109417959a 100644
--- a/external/mpl/bind/dist/lib/dns/include/dns/view.h
+++ b/external/mpl/bind/dist/lib/dns/include/dns/view.h
@@ -1,4 +1,4 @@
-/* $NetBSD: view.h,v 1.8 2022/09/23 12:15:30 christos Exp $ */
+/* $NetBSD: view.h,v 1.9 2023/06/26 22:03:00 christos Exp $ */
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
@@ -1199,7 +1199,7 @@ dns_view_ntacovers(dns_view_t *view, isc_stdtime_t now, const dns_name_t *name,
void
dns_view_untrust(dns_view_t *view, const dns_name_t *keyname,
- dns_rdata_dnskey_t *dnskey);
+ const dns_rdata_dnskey_t *dnskey);
/*%<
* Remove keys that match 'keyname' and 'dnskey' from the views trust
* anchors.
@@ -1216,6 +1216,19 @@ dns_view_untrust(dns_view_t *view, const dns_name_t *keyname,
* \li 'dnskey' is valid.
*/
+bool
+dns_view_istrusted(dns_view_t *view, const dns_name_t *keyname,
+ const dns_rdata_dnskey_t *dnskey);
+/*%<
+ * Determine if the key defined by 'keyname' and 'dnskey' is
+ * trusted by 'view'.
+ *
+ * Requires:
+ * \li 'view' is valid.
+ * \li 'keyname' is valid.
+ * \li 'dnskey' is valid.
+ */
+
isc_result_t
dns_view_setnewzones(dns_view_t *view, bool allow, void *cfgctx,
void (*cfg_destroy)(void **), uint64_t mapsize);
diff --git a/external/mpl/bind/dist/lib/dns/include/dns/zt.h b/external/mpl/bind/dist/lib/dns/include/dns/zt.h
index 8adecef5da4..0a822fceffd 100644
--- a/external/mpl/bind/dist/lib/dns/include/dns/zt.h
+++ b/external/mpl/bind/dist/lib/dns/include/dns/zt.h
@@ -1,4 +1,4 @@
-/* $NetBSD: zt.h,v 1.7 2023/01/25 21:43:30 christos Exp $ */
+/* $NetBSD: zt.h,v 1.8 2023/06/26 22:03:00 christos Exp $ */
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
@@ -21,6 +21,7 @@
#include <stdbool.h>
#include <isc/lang.h>
+#include <isc/rwlock.h>
#include <dns/types.h>
diff --git a/external/mpl/bind/dist/lib/dns/keymgr.c b/external/mpl/bind/dist/lib/dns/keymgr.c
index 5a149a198c8..285470e3284 100644
--- a/external/mpl/bind/dist/lib/dns/keymgr.c
+++ b/external/mpl/bind/dist/lib/dns/keymgr.c
@@ -1,4 +1,4 @@
-/* $NetBSD: keymgr.c,v 1.9 2023/01/25 21:43:30 christos Exp $ */
+/* $NetBSD: keymgr.c,v 1.10 2023/06/26 22:03:00 christos Exp $ */
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
@@ -2278,9 +2278,19 @@ keymgr_checkds(dns_kasp_t *kasp, dns_dnsseckeylist_t *keyring,
}
if (dspublish) {
+ dst_key_state_t s;
dst_key_settime(ksk_key->key, DST_TIME_DSPUBLISH, when);
+ result = dst_key_getstate(ksk_key->key, DST_KEY_DS, &s);
+ if (result != ISC_R_SUCCESS || s != RUMOURED) {
+ dst_key_setstate(ksk_key->key, DST_KEY_DS, RUMOURED);
+ }
} else {
+ dst_key_state_t s;
dst_key_settime(ksk_key->key, DST_TIME_DSDELETE, when);
+ result = dst_key_getstate(ksk_key->key, DST_KEY_DS, &s);
+ if (result != ISC_R_SUCCESS || s != UNRETENTIVE) {
+ dst_key_setstate(ksk_key->key, DST_KEY_DS, UNRETENTIVE);
+ }
}
if (isc_log_wouldlog(dns_lctx, ISC_LOG_NOTICE)) {
diff --git a/external/mpl/bind/dist/lib/dns/keytable.c b/external/mpl/bind/dist/lib/dns/keytable.c
index 66a33b00ce8..23e0253d987 100644
--- a/external/mpl/bind/dist/lib/dns/keytable.c
+++ b/external/mpl/bind/dist/lib/dns/keytable.c
@@ -1,4 +1,4 @@
-/* $NetBSD: keytable.c,v 1.8 2022/09/23 12:15:29 christos Exp $ */
+/* $NetBSD: keytable.c,v 1.9 2023/06/26 22:03:00 christos Exp $ */
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
@@ -461,10 +461,6 @@ dns_keytable_deletekey(dns_keytable_t *keytable, const dns_name_t *keyname,
REQUIRE(VALID_KEYTABLE(keytable));
REQUIRE(dnskey != NULL);
- isc_buffer_init(&b, data, sizeof(data));
- dns_rdata_fromstruct(&rdata, dnskey->common.rdclass,
- dns_rdatatype_dnskey, dnskey, &b);
-
RWLOCK(&keytable->rwlock, isc_rwlocktype_write);
result = dns_rbt_findnode(keytable->table, keyname, NULL, &node, NULL,
DNS_RBTFIND_NOOPTIONS, NULL, NULL);
@@ -491,6 +487,13 @@ dns_keytable_deletekey(dns_keytable_t *keytable, const dns_name_t *keyname,
}
RWUNLOCK(&knode->rwlock, isc_rwlocktype_read);
+ isc_buffer_init(&b, data, sizeof(data));
+ result = dns_rdata_fromstruct(&rdata, dnskey->common.rdclass,
+ dns_rdatatype_dnskey, dnskey, &b);
+ if (result != ISC_R_SUCCESS) {
+ goto finish;
+ }
+
result = dns_ds_fromkeyrdata(keyname, &rdata, DNS_DSDIGEST_SHA256,
digest, &ds);
if (result != ISC_R_SUCCESS) {
diff --git a/external/mpl/bind/dist/lib/dns/master.c b/external/mpl/bind/dist/lib/dns/master.c
index 3c9077c3b49..096d6f49d69 100644
--- a/external/mpl/bind/dist/lib/dns/master.c
+++ b/external/mpl/bind/dist/lib/dns/master.c
@@ -1,4 +1,4 @@
-/* $NetBSD: master.c,v 1.10 2023/01/25 21:43:30 christos Exp $ */
+/* $NetBSD: master.c,v 1.11 2023/06/26 22:03:00 christos Exp $ */
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
@@ -1103,7 +1103,7 @@ load_text(dns_loadctx_t *lctx) {
char *lhs = NULL;
char *gtype = NULL;
char *rhs = NULL;
- const char *source = "";
+ const char *source;
unsigned long line = 0;
bool explicit_ttl;
char classname1[DNS_RDATACLASS_FORMATSIZE];
diff --git a/external/mpl/bind/dist/lib/dns/nsec3.c b/external/mpl/bind/dist/lib/dns/nsec3.c
index 63f767af717..5997bb1fd16 100644
--- a/external/mpl/bind/dist/lib/dns/nsec3.c
+++ b/external/mpl/bind/dist/lib/dns/nsec3.c
@@ -1,4 +1,4 @@
-/* $NetBSD: nsec3.c,v 1.11 2023/01/25 21:43:30 christos Exp $ */
+/* $NetBSD: nsec3.c,v 1.12 2023/06/26 22:03:00 christos Exp $ */
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
@@ -1445,7 +1445,7 @@ dns_nsec3_delnsec3(dns_db_t *db, dns_dbversion_t *version,
result = dns_dbiterator_seek(dbit, hashname);
if (result == ISC_R_NOTFOUND || result == DNS_R_PARTIALMATCH) {
- goto success;
+ goto cleanup_orphaned_ents;
}
if (result != ISC_R_SUCCESS) {
goto failure;
@@ -1457,7 +1457,7 @@ dns_nsec3_delnsec3(dns_db_t *db, dns_dbversion_t *version,
(isc_stdtime_t)0, &rdataset, NULL);
dns_db_detachnode(db, &node);
if (result == ISC_R_NOTFOUND) {
- goto success;
+ goto cleanup_orphaned_ents;
}
if (result != ISC_R_SUCCESS) {
goto failure;
@@ -1542,6 +1542,7 @@ dns_nsec3_delnsec3(dns_db_t *db, dns_dbversion_t *version,
/*
* Delete NSEC3 records for now non active nodes.
*/
+cleanup_orphaned_ents:
dns_name_init(&empty, NULL);
dns_name_clone(name, &empty);
do {
diff --git a/external/mpl/bind/dist/lib/dns/nta.c b/external/mpl/bind/dist/lib/dns/nta.c
index 6c846c0d813..d740ff0138e 100644
--- a/external/mpl/bind/dist/lib/dns/nta.c
+++ b/external/mpl/bind/dist/lib/dns/nta.c
@@ -1,4 +1,4 @@
-/* $NetBSD: nta.c,v 1.8 2022/09/23 12:15:30 christos Exp $ */
+/* $NetBSD: nta.c,v 1.9 2023/06/26 22:03:00 christos Exp $ */
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
@@ -79,7 +79,7 @@ nta_detach(isc_mem_t *mctx, dns_nta_t **ntap) {
(void)isc_timer_reset(nta->timer,
isc_timertype_inactive, NULL,
NULL, true);
- isc_timer_detach(&nta->timer);
+ isc_timer_destroy(&nta->timer);
}
if (dns_rdataset_isassociated(&nta->rdataset)) {
dns_rdataset_disassociate(&nta->rdataset);
@@ -295,6 +295,9 @@ settimer(dns_ntatable_t *ntatable, dns_nta_t *nta, uint32_t lifetime) {
result = isc_timer_create(ntatable->timermgr, isc_timertype_ticker,
NULL, &interval, ntatable->task, checkbogus,
nta, &nta->timer);
+ if (result != ISC_R_SUCCESS) {
+ isc_timer_destroy(&nta->timer);
+ }
return (result);
}
@@ -481,7 +484,7 @@ again:
(void)isc_timer_reset(nta->timer,
isc_timertype_inactive, NULL,
NULL, true);
- isc_timer_detach(&nta->timer);
+ isc_timer_destroy(&nta->timer);
}
result = deletenode(ntatable, foundname);
diff --git a/external/mpl/bind/dist/lib/dns/rbt.c b/external/mpl/bind/dist/lib/dns/rbt.c
index f08016d722c..8bb723a48b2 100644
--- a/external/mpl/bind/dist/lib/dns/rbt.c
+++ b/external/mpl/bind/dist/lib/dns/rbt.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rbt.c,v 1.12 2023/01/25 21:43:30 christos Exp $ */
+/* $NetBSD: rbt.c,v 1.13 2023/06/26 22:03:00 christos Exp $ */
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
@@ -37,6 +37,7 @@
* efficient macro calls instead of functions for a few operations.
*/
#define DNS_NAME_USEINLINE 1
+#define ALIGNMENT_SIZE 8U /* see lib/isc/mem.c */
#include <unistd.h>
@@ -801,8 +802,12 @@ treefix(dns_rbt_t *rbt, void *base, size_t filesize, dns_rbtnode_t *n,
return (ISC_R_SUCCESS);
}
+#define CHECK_ALIGNMENT(n) \
+ (((uintptr_t)n & ~((uintptr_t)ALIGNMENT_SIZE - 1)) == (uintptr_t)n)
+
CONFIRM((void *)n >= base);
CONFIRM((size_t)((char *)n - (char *)base) <= nodemax);
+ CONFIRM(CHECK_ALIGNMENT(n));
CONFIRM(DNS_RBTNODE_VALID(n));
dns_name_init(&nodename, NULL);
@@ -823,6 +828,7 @@ treefix(dns_rbt_t *rbt, void *base, size_t filesize, dns_rbtnode_t *n,
CONFIRM(n->left <= (dns_rbtnode_t *)nodemax);
n->left = getleft(n, rbt->mmap_location);
n->left_is_relative = 0;
+ CONFIRM(CHECK_ALIGNMENT(n->left));
CONFIRM(DNS_RBTNODE_VALID(n->left));
} else {
CONFIRM(n->left == NULL);
@@ -832,6 +838,7 @@ treefix(dns_rbt_t *rbt, void *base, size_t filesize, dns_rbtnode_t *n,
CONFIRM(n->right <= (dns_rbtnode_t *)nodemax);
n->right = getright(n, rbt->mmap_location);
n->right_is_relative = 0;
+ CONFIRM(CHECK_ALIGNMENT(n->right));
CONFIRM(DNS_RBTNODE_VALID(n->right));
} else {
CONFIRM(n->right == NULL);
@@ -842,6 +849,7 @@ treefix(dns_rbt_t *rbt, void *base, size_t filesize, dns_rbtnode_t *n,
n->down = getdown(n, rbt->mmap_location);
n->down_is_relative = 0;
CONFIRM(n->down > (dns_rbtnode_t *)n);
+ CONFIRM(CHECK_ALIGNMENT(n->down));
CONFIRM(DNS_RBTNODE_VALID(n->down));
} else {
CONFIRM(n->down == NULL);
@@ -852,6 +860,7 @@ treefix(dns_rbt_t *rbt, void *base, size_t filesize, dns_rbtnode_t *n,
n->parent = getparent(n, rbt->mmap_location);
n->parent_is_relative = 0;
CONFIRM(n->parent < (dns_rbtnode_t *)n);
+ CONFIRM(CHECK_ALIGNMENT(n->parent));
CONFIRM(DNS_RBTNODE_VALID(n->parent));
} else {
CONFIRM(n->parent == NULL);
@@ -862,6 +871,7 @@ treefix(dns_rbt_t *rbt, void *base, size_t filesize, dns_rbtnode_t *n,
n->data = getdata(n, rbt->mmap_location);
n->data_is_relative = 0;
CONFIRM(n->data > (void *)n);
+ CONFIRM(CHECK_ALIGNMENT(n->data));
} else {
CONFIRM(n->data == NULL);
}
diff --git a/external/mpl/bind/dist/lib/dns/rbtdb.c b/external/mpl/bind/dist/lib/dns/rbtdb.c
index 943e8a462d5..81aa94a3ac1 100644
--- a/external/mpl/bind/dist/lib/dns/rbtdb.c
+++ b/external/mpl/bind/dist/lib/dns/rbtdb.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rbtdb.c,v 1.16 2023/01/25 21:43:30 christos Exp $ */
+/* $NetBSD: rbtdb.c,v 1.17 2023/06/26 22:03:00 christos Exp $ */
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
@@ -607,7 +607,7 @@ static void
expire_header(dns_rbtdb_t *rbtdb, rdatasetheader_t *header, bool tree_locked,
expire_t reason);
static void
-overmem_purge(dns_rbtdb_t *rbtdb, unsigned int locknum_start, isc_stdtime_t now,
+overmem_purge(dns_rbtdb_t *rbtdb, unsigned int locknum_start, size_t purgesize,
bool tree_locked);
static void
resign_insert(dns_rbtdb_t *rbtdb, int idx, rdatasetheader_t *newheader);
@@ -2787,7 +2787,7 @@ end:
* tree_lock(write) must be held.
*/
static isc_result_t
-add_wildcard_magic(dns_rbtdb_t *rbtdb, const dns_name_t *name) {
+add_wildcard_magic(dns_rbtdb_t *rbtdb, const dns_name_t *name, bool lock) {
isc_result_t result;
dns_name_t foundname;
dns_offsets_t offsets;
@@ -2807,7 +2807,15 @@ add_wildcard_magic(dns_rbtdb_t *rbtdb, const dns_name_t *name) {
node->nsec = DNS_RBT_NSEC_NORMAL;
}
node->find_callback = 1;
+ if (lock) {
+ NODE_LOCK(&rbtdb->node_locks[node->locknum].lock,
+ isc_rwlocktype_write);
+ }
node->wild = 1;
+ if (lock) {
+ NODE_UNLOCK(&rbtdb->node_locks[node->locknum].lock,
+ isc_rwlocktype_write);
+ }
return (ISC_R_SUCCESS);
}
@@ -2815,7 +2823,7 @@ add_wildcard_magic(dns_rbtdb_t *rbtdb, const dns_name_t *name) {
* tree_lock(write) must be held.
*/
static isc_result_t
-add_empty_wildcards(dns_rbtdb_t *rbtdb, const dns_name_t *name) {
+add_empty_wildcards(dns_rbtdb_t *rbtdb, const dns_name_t *name, bool lock) {
isc_result_t result;
dns_name_t foundname;
dns_offsets_t offsets;
@@ -2829,7 +2837,7 @@ add_empty_wildcards(dns_rbtdb_t *rbtdb, const dns_name_t *name) {
dns_rbtnode_t *node = NULL; /* dummy */
dns_name_getlabelsequence(name, n - i, i, &foundname);
if (dns_name_iswildcard(&foundname)) {
- result = add_wildcard_magic(rbtdb, &foundname);
+ result = add_wildcard_magic(rbtdb, &foundname, lock);
if (result != ISC_R_SUCCESS) {
return (result);
}
@@ -2881,11 +2889,11 @@ findnodeintree(dns_rbtdb_t *rbtdb, dns_rbt_t *tree, const dns_name_t *name,
dns_rbt_namefromnode(node, &nodename);
node->locknum = node->hashval % rbtdb->node_lock_count;
if (tree == rbtdb->tree) {
- add_empty_wildcards(rbtdb, name);
+ add_empty_wildcards(rbtdb, name, true);
if (dns_name_iswildcard(name)) {
- result = add_wildcard_magic(rbtdb,
- name);
+ result = add_wildcard_magic(rbtdb, name,
+ true);
if (result != ISC_R_SUCCESS) {
RWUNLOCK(&rbtdb->tree_lock,
locktype);
@@ -6817,6 +6825,16 @@ cleanup:
static dns_dbmethods_t zone_methods;
+static size_t
+rdataset_size(rdatasetheader_t *header) {
+ if (!NONEXISTENT(header)) {
+ return (dns_rdataslab_size((unsigned char *)header,
+ sizeof(*header)));
+ }
+
+ return (sizeof(*header));
+}
+
static isc_result_t
addrdataset(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version,
isc_stdtime_t now, dns_rdataset_t *rdataset, unsigned int options,
@@ -6981,7 +6999,8 @@ addrdataset(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version,
}
if (cache_is_overmem) {
- overmem_purge(rbtdb, rbtnode->locknum, now, tree_locked);
+ overmem_purge(rbtdb, rbtnode->locknum, rdataset_size(newheader),
+ tree_locked);
}
NODE_LOCK(&rbtdb->node_locks[rbtnode->locknum].lock,
@@ -7000,10 +7019,18 @@ addrdataset(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version,
}
header = isc_heap_element(rbtdb->heaps[rbtnode->locknum], 1);
- if (header != NULL && header->rdh_ttl + rbtdb->serve_stale_ttl <
- now - RBTDB_VIRTUAL)
- {
- expire_header(rbtdb, header, tree_locked, expire_ttl);
+ if (header != NULL) {
+ dns_ttl_t rdh_ttl = header->rdh_ttl;
+
+ /* Only account for stale TTL if cache is not overmem */
+ if (!cache_is_overmem) {
+ rdh_ttl += rbtdb->serve_stale_ttl;
+ }
+
+ if (rdh_ttl < now - RBTDB_VIRTUAL) {
+ expire_header(rbtdb, header, tree_locked,
+ expire_ttl);
+ }
}
/*
@@ -7451,7 +7478,7 @@ loading_addrdataset(void *arg, const dns_name_t *name,
if (rdataset->type != dns_rdatatype_nsec3 &&
rdataset->covers != dns_rdatatype_nsec3)
{
- add_empty_wildcards(rbtdb, name);
+ add_empty_wildcards(rbtdb, name, false);
}
if (dns_name_iswildcard(name)) {
@@ -7467,7 +7494,7 @@ loading_addrdataset(void *arg, const dns_name_t *name,
if (rdataset->type == dns_rdatatype_nsec3) {
return (DNS_R_INVALIDNSEC3);
}
- result = add_wildcard_magic(rbtdb, name);
+ result = add_wildcard_magic(rbtdb, name, false);
if (result != ISC_R_SUCCESS) {
return (result);
}
@@ -10541,52 +10568,58 @@ update_header(dns_rbtdb_t *rbtdb, rdatasetheader_t *header, isc_stdtime_t now) {
ISC_LIST_PREPEND(rbtdb->rdatasets[header->node->locknum], header, link);
}
+static size_t
+expire_lru_headers(dns_rbtdb_t *rbtdb, unsigned int locknum, size_t purgesize,
+ bool tree_locked) {
+ rdatasetheader_t *header, *header_prev;
+ size_t purged = 0;
+
+ for (header = ISC_LIST_TAIL(rbtdb->rdatasets[locknum]);
+ header != NULL && purged <= purgesize; header = header_prev)
+ {
+ header_prev = ISC_LIST_PREV(header, link);
+ /*
+ * Unlink the entry at this point to avoid checking it
+ * again even if it's currently used someone else and
+ * cannot be purged at this moment. This entry won't be
+ * referenced any more (so unlinking is safe) since the
+ * TTL was reset to 0.
+ */
+ ISC_LIST_UNLINK(rbtdb->rdatasets[locknum], header, link);
+ size_t header_size = rdataset_size(header);
+ expire_header(rbtdb, header, tree_locked, expire_lru);
+ purged += header_size;
+ }
+
+ return (purged);
+}
+
/*%
- * Purge some expired and/or stale (i.e. unused for some period) cache entries
- * under an overmem condition. To recover from this condition quickly, up to
- * 2 entries will be purged. This process is triggered while adding a new
- * entry, and we specifically avoid purging entries in the same LRU bucket as
- * the one to which the new entry will belong. Otherwise, we might purge
- * entries of the same name of different RR types while adding RRsets from a
- * single response (consider the case where we're adding A and AAAA glue records
- * of the same NS name).
+ * Purge some stale (i.e. unused for some period - LRU based cleaning) cache
+ * entries under the overmem condition. To recover from this condition quickly,
+ * we cleanup entries up to the size of newly added rdata (passed as purgesize).
+ *
+ * This process is triggered while adding a new entry, and we specifically avoid
+ * purging entries in the same LRU bucket as the one to which the new entry will
+ * belong. Otherwise, we might purge entries of the same name of different RR
+ * types while adding RRsets from a single response (consider the case where
+ * we're adding A and AAAA glue records of the same NS name).
*/
static void
-overmem_purge(dns_rbtdb_t *rbtdb, unsigned int locknum_start, isc_stdtime_t now,
+overmem_purge(dns_rbtdb_t *rbtdb, unsigned int locknum_start, size_t purgesize,
bool tree_locked) {
- rdatasetheader_t *header, *header_prev;
unsigned int locknum;
- int purgecount = 2;
+ size_t purged = 0;
for (locknum = (locknum_start + 1) % rbtdb->node_lock_count;
- locknum != locknum_start && purgecount > 0;
+ locknum != locknum_start && purged <= purgesize;
locknum = (locknum + 1) % rbtdb->node_lock_count)
{
NODE_LOCK(&rbtdb->node_locks[locknum].lock,
isc_rwlocktype_write);
- header = isc_heap_element(rbtdb->heaps[locknum], 1);
- if (header && header->rdh_ttl < now - RBTDB_VIRTUAL) {
- expire_header(rbtdb, header, tree_locked, expire_ttl);
- purgecount--;
- }
-
- for (header = ISC_LIST_TAIL(rbtdb->rdatasets[locknum]);
- header != NULL && purgecount > 0; header = header_prev)
- {
- header_prev = ISC_LIST_PREV(header, link);
- /*
- * Unlink the entry at this point to avoid checking it
- * again even if it's currently used someone else and
- * cannot be purged at this moment. This entry won't be
- * referenced any more (so unlinking is safe) since the
- * TTL was reset to 0.
- */
- ISC_LIST_UNLINK(rbtdb->rdatasets[locknum], header,
- link);
- expire_header(rbtdb, header, tree_locked, expire_lru);
- purgecount--;
- }
+ purged += expire_lru_headers(rbtdb, locknum, purgesize - purged,
+ tree_locked);
NODE_UNLOCK(&rbtdb->node_locks[locknum].lock,
isc_rwlocktype_write);
diff --git a/external/mpl/bind/dist/lib/dns/request.c b/external/mpl/bind/dist/lib/dns/request.c
index c3dfc09ab9e..68449e5d237 100644
--- a/external/mpl/bind/dist/lib/dns/request.c
+++ b/external/mpl/bind/dist/lib/dns/request.c
@@ -1,4 +1,4 @@
-/* $NetBSD: request.c,v 1.7 2023/01/25 21:43:30 christos Exp $ */
+/* $NetBSD: request.c,v 1.8 2023/06/26 22:03:00 christos Exp $ */
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
@@ -1300,6 +1300,9 @@ req_connected(isc_task_t *task, isc_event_t *event) {
req_log(ISC_LOG_DEBUG(3), "req_connected: request %p", request);
+ result = sevent->result;
+ isc_event_free(&event);
+
LOCK(&request->requestmgr->locks[request->hash]);
request->flags &= ~DNS_REQUEST_F_CONNECTING;
@@ -1314,7 +1317,6 @@ req_connected(isc_task_t *task, isc_event_t *event) {
}
} else {
dns_dispatch_starttcp(request->dispatch);
- result = sevent->result;
if (result == ISC_R_SUCCESS) {
result = req_send(request, task, NULL);
}
@@ -1325,13 +1327,13 @@ req_connected(isc_task_t *task, isc_event_t *event) {
}
}
UNLOCK(&request->requestmgr->locks[request->hash]);
- isc_event_free(&event);
}
static void
req_senddone(isc_task_t *task, isc_event_t *event) {
isc_socketevent_t *sevent = (isc_socketevent_t *)event;
dns_request_t *request = event->ev_arg;
+ isc_result_t result = sevent->result;
REQUIRE(event->ev_type == ISC_SOCKEVENT_SENDDONE);
REQUIRE(VALID_REQUEST(request));
@@ -1341,6 +1343,8 @@ req_senddone(isc_task_t *task, isc_event_t *event) {
UNUSED(task);
+ isc_event_free(&event);
+
LOCK(&request->requestmgr->locks[request->hash]);
request->flags &= ~DNS_REQUEST_F_SENDING;
@@ -1353,13 +1357,11 @@ req_senddone(isc_task_t *task, isc_event_t *event) {
} else {
send_if_done(request, ISC_R_CANCELED);
}
- } else if (sevent->result != ISC_R_SUCCESS) {
+ } else if (result != ISC_R_SUCCESS) {
req_cancel(request);
send_if_done(request, ISC_R_CANCELED);
}
UNLOCK(&request->requestmgr->locks[request->hash]);
-
- isc_event_free(&event);
}
static void
@@ -1409,14 +1411,18 @@ static void
req_timeout(isc_task_t *task, isc_event_t *event) {
dns_request_t *request = event->ev_arg;
isc_result_t result;
+ isc_eventtype_t ev_type = event->ev_type;
REQUIRE(VALID_REQUEST(request));
req_log(ISC_LOG_DEBUG(3), "req_timeout: request %p", request);
UNUSED(task);
+
+ isc_event_free(&event);
+
LOCK(&request->requestmgr->locks[request->hash]);
- if (event->ev_type == ISC_TIMEREVENT_TICK && request->udpcount-- != 0) {
+ if (ev_type == ISC_TIMEREVENT_TICK && request->udpcount-- != 0) {
if (!DNS_REQUEST_SENDING(request)) {
result = req_send(request, task, &request->destaddr);
if (result != ISC_R_SUCCESS) {
@@ -1430,7 +1436,6 @@ req_timeout(isc_task_t *task, isc_event_t *event) {
send_if_done(request, ISC_R_TIMEDOUT);
}
UNLOCK(&request->requestmgr->locks[request->hash]);
- isc_event_free(&event);
}
static void
@@ -1473,7 +1478,7 @@ req_destroy(dns_request_t *request) {
dns_dispatch_detach(&request->dispatch);
}
if (request->timer != NULL) {
- isc_timer_detach(&request->timer);
+ isc_timer_destroy(&request->timer);
}
if (request->tsig != NULL) {
isc_buffer_free(&request->tsig);
@@ -1505,7 +1510,7 @@ req_cancel(dns_request_t *request) {
request->flags |= DNS_REQUEST_F_CANCELED;
if (request->timer != NULL) {
- isc_timer_detach(&request->timer);
+ isc_timer_destroy(&request->timer);
}
dispattr = dns_dispatch_getattributes(request->dispatch);
sock = NULL;
diff --git a/external/mpl/bind/dist/lib/dns/resolver.c b/external/mpl/bind/dist/lib/dns/resolver.c
index 53156ac14b8..e574d9b7c47 100644
--- a/external/mpl/bind/dist/lib/dns/resolver.c
+++ b/external/mpl/bind/dist/lib/dns/resolver.c
@@ -1,4 +1,4 @@
-/* $NetBSD: resolver.c,v 1.16 2023/01/25 21:43:30 christos Exp $ */
+/* $NetBSD: resolver.c,v 1.17 2023/06/26 22:03:00 christos Exp $ */
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
@@ -4708,9 +4708,9 @@ fctx_destroy(fetchctx_t *fctx) {
isc_counter_detach(&fctx->qc);
fcount_decr(fctx);
- isc_timer_detach(&fctx->timer);
+ isc_timer_destroy(&fctx->timer);
if (fctx->timer_try_stale != NULL) {
- isc_timer_detach(&fctx->timer_try_stale);
+ isc_timer_destroy(&fctx->timer_try_stale);
}
dns_message_detach(&fctx->qmessage);
if (dns_name_countlabels(&fctx->domain) > 0) {
@@ -5485,8 +5485,8 @@ cleanup_mctx:
isc_mem_detach(&fctx->mctx);
dns_adb_detach(&fctx->adb);
dns_db_detach(&fctx->cache);
- isc_timer_detach(&fctx->timer);
- isc_timer_detach(&fctx->timer_try_stale);
+ isc_timer_destroy(&fctx->timer);
+ isc_timer_destroy(&fctx->timer_try_stale);
cleanup_qmessage:
dns_message_detach(&fctx->qmessage);
@@ -10488,7 +10488,7 @@ destroy(dns_resolver_t *res) {
#if USE_MBSLOCK
isc_rwlock_destroy(&res->mbslock);
#endif /* if USE_MBSLOCK */
- isc_timer_detach(&res->spillattimer);
+ isc_timer_destroy(&res->spillattimer);
res->magic = 0;
isc_mem_put(res->mctx, res, sizeof(*res));
}
diff --git a/external/mpl/bind/dist/lib/dns/rpz.c b/external/mpl/bind/dist/lib/dns/rpz.c
index cd2557ecb35..95dbb51ae58 100644
--- a/external/mpl/bind/dist/lib/dns/rpz.c
+++ b/external/mpl/bind/dist/lib/dns/rpz.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rpz.c,v 1.12 2023/01/25 21:43:30 christos Exp $ */
+/* $NetBSD: rpz.c,v 1.13 2023/06/26 22:03:00 christos Exp $ */
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
@@ -2232,7 +2232,7 @@ rpz_detach(dns_rpz_zone_t **rpzp) {
isc_timer_reset(rpz->updatetimer, isc_timertype_inactive, NULL,
NULL, true);
- isc_timer_detach(&rpz->updatetimer);
+ isc_timer_destroy(&rpz->updatetimer);
isc_ht_destroy(&rpz->nodes);
diff --git a/external/mpl/bind/dist/lib/dns/validator.c b/external/mpl/bind/dist/lib/dns/validator.c
index e86e6fd0a96..71aaf18c4d5 100644
--- a/external/mpl/bind/dist/lib/dns/validator.c
+++ b/external/mpl/bind/dist/lib/dns/validator.c
@@ -1,4 +1,4 @@
-/* $NetBSD: validator.c,v 1.12 2023/01/25 21:43:30 christos Exp $ */
+/* $NetBSD: validator.c,v 1.13 2023/06/26 22:03:00 christos Exp $ */
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
@@ -1399,26 +1399,50 @@ selfsigned_dnskey(dns_validator_t *val) {
continue;
}
- result = dns_dnssec_keyfromrdata(name, &keyrdata, mctx,
- &dstkey);
- if (result != ISC_R_SUCCESS) {
+ /*
+ * If the REVOKE bit is not set we have a
+ * theoretically self signed DNSKEY RRset.
+ * This will be verified later.
+ */
+ if ((key.flags & DNS_KEYFLAG_REVOKE) == 0) {
+ answer = true;
continue;
}
- result = dns_dnssec_verify(name, rdataset, dstkey, true,
- val->view->maxbits, mctx,
- &sigrdata, NULL);
- dst_key_free(&dstkey);
+ result = dns_dnssec_keyfromrdata(name, &keyrdata, mctx,
+ &dstkey);
if (result != ISC_R_SUCCESS) {
continue;
}
- if ((key.flags & DNS_KEYFLAG_REVOKE) == 0) {
- answer = true;
- continue;
+ /*
+ * If this RRset is pending and it is trusted,
+ * see if it was self signed by this DNSKEY.
+ */
+ if (DNS_TRUST_PENDING(rdataset->trust) &&
+ dns_view_istrusted(val->view, name, &key))
+ {
+ result = dns_dnssec_verify(
+ name, rdataset, dstkey, true,
+ val->view->maxbits, mctx, &sigrdata,
+ NULL);
+ if (result == ISC_R_SUCCESS) {
+ /*
+ * The key with the REVOKE flag has
+ * self signed the RRset so it is no
+ * good.
+ */
+ dns_view_untrust(val->view, name, &key);
+ }
+ } else if (rdataset->trust >= dns_trust_secure) {
+ /*
+ * We trust this RRset so if the key is
+ * marked revoked remove it.
+ */
+ dns_view_untrust(val->view, name, &key);
}
- dns_view_untrust(val->view, name, &key);
+ dst_key_free(&dstkey);
}
}
diff --git a/external/mpl/bind/dist/lib/dns/view.c b/external/mpl/bind/dist/lib/dns/view.c
index 5861d3108a5..299dadef501 100644
--- a/external/mpl/bind/dist/lib/dns/view.c
+++ b/external/mpl/bind/dist/lib/dns/view.c
@@ -1,4 +1,4 @@
-/* $NetBSD: view.c,v 1.13 2023/01/25 21:43:30 christos Exp $ */
+/* $NetBSD: view.c,v 1.14 2023/06/26 22:03:00 christos Exp $ */
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
@@ -1994,26 +1994,28 @@ dns_view_issecuredomain(dns_view_t *view, const dns_name_t *name,
void
dns_view_untrust(dns_view_t *view, const dns_name_t *keyname,
- dns_rdata_dnskey_t *dnskey) {
+ const dns_rdata_dnskey_t *dnskey) {
isc_result_t result;
dns_keytable_t *sr = NULL;
+ dns_rdata_dnskey_t tmpkey;
REQUIRE(DNS_VIEW_VALID(view));
REQUIRE(keyname != NULL);
REQUIRE(dnskey != NULL);
- /*
- * Clear the revoke bit, if set, so that the key will match what's
- * in secroots now.
- */
- dnskey->flags &= ~DNS_KEYFLAG_REVOKE;
-
result = dns_view_getsecroots(view, &sr);
if (result != ISC_R_SUCCESS) {
return;
}
- result = dns_keytable_deletekey(sr, keyname, dnskey);
+ /*
+ * Clear the revoke bit, if set, so that the key will match what's
+ * in secroots now.
+ */
+ tmpkey = *dnskey;
+ tmpkey.flags &= ~DNS_KEYFLAG_REVOKE;
+
+ result = dns_keytable_deletekey(sr, keyname, &tmpkey);
if (result == ISC_R_SUCCESS) {
/*
* If key was found in secroots, then it was a
@@ -2028,6 +2030,88 @@ dns_view_untrust(dns_view_t *view, const dns_name_t *keyname,
dns_keytable_detach(&sr);
}
+bool
+dns_view_istrusted(dns_view_t *view, const dns_name_t *keyname,
+ const dns_rdata_dnskey_t *dnskey) {
+ isc_result_t result;
+ dns_keytable_t *sr = NULL;
+ dns_keynode_t *knode = NULL;
+ bool answer = false;
+ dns_rdataset_t dsset;
+
+ REQUIRE(DNS_VIEW_VALID(view));
+ REQUIRE(keyname != NULL);
+ REQUIRE(dnskey != NULL);
+
+ result = dns_view_getsecroots(view, &sr);
+ if (result != ISC_R_SUCCESS) {
+ return (false);
+ }
+
+ dns_rdataset_init(&dsset);
+ result = dns_keytable_find(sr, keyname, &knode);
+ if (result == ISC_R_SUCCESS) {
+ if (dns_keynode_dsset(knode, &dsset)) {
+ dns_rdata_t rdata = DNS_RDATA_INIT;
+ unsigned char data[4096], digest[DNS_DS_BUFFERSIZE];
+ dns_rdata_dnskey_t tmpkey = *dnskey;
+ dns_rdata_ds_t ds;
+ isc_buffer_t b;
+ dns_rdataclass_t rdclass = tmpkey.common.rdclass;
+
+ /*
+ * Clear the revoke bit, if set, so that the key
+ * will match what's in secroots now.
+ */
+ tmpkey.flags &= ~DNS_KEYFLAG_REVOKE;
+
+ isc_buffer_init(&b, data, sizeof(data));
+ result = dns_rdata_fromstruct(&rdata, rdclass,
+ dns_rdatatype_dnskey,
+ &tmpkey, &b);
+ if (result != ISC_R_SUCCESS) {
+ goto finish;
+ }
+
+ result = dns_ds_fromkeyrdata(keyname, &rdata,
+ DNS_DSDIGEST_SHA256,
+ digest, &ds);
+ if (result != ISC_R_SUCCESS) {
+ goto finish;
+ }
+
+ dns_rdata_reset(&rdata);
+ isc_buffer_init(&b, data, sizeof(data));
+ result = dns_rdata_fromstruct(
+ &rdata, rdclass, dns_rdatatype_ds, &ds, &b);
+ if (result != ISC_R_SUCCESS) {
+ goto finish;
+ }
+
+ result = dns_rdataset_first(&dsset);
+ while (result == ISC_R_SUCCESS) {
+ dns_rdata_t this = DNS_RDATA_INIT;
+ dns_rdataset_current(&dsset, &this);
+ if (dns_rdata_compare(&rdata, &this) == 0) {
+ answer = true;
+ break;
+ }
+ result = dns_rdataset_next(&dsset);
+ }
+ }
+ }
+
+finish:
+ if (dns_rdataset_isassociated(&dsset)) {
+ dns_rdataset_disassociate(&dsset);
+ }
+ if (knode != NULL) {
+ dns_keytable_detachkeynode(sr, &knode);
+ }
+ dns_keytable_detach(&sr);
+ return (answer);
+}
+
/*
* Create path to a directory and a filename constructed from viewname.
* This is a front-end to isc_file_sanitize(), allowing backward
diff --git a/external/mpl/bind/dist/lib/dns/xfrin.c b/external/mpl/bind/dist/lib/dns/xfrin.c
index ba9681e2eae..c0c3a4d2c41 100644
--- a/external/mpl/bind/dist/lib/dns/xfrin.c
+++ b/external/mpl/bind/dist/lib/dns/xfrin.c
@@ -1,4 +1,4 @@
-/* $NetBSD: xfrin.c,v 1.12 2023/01/25 21:43:30 christos Exp $ */
+/* $NetBSD: xfrin.c,v 1.13 2023/06/26 22:03:00 christos Exp $ */
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
@@ -952,7 +952,7 @@ xfrin_create(isc_mem_t *mctx, dns_zone_t *zone, dns_db_t *db, isc_task_t *task,
failure:
if (xfr->timer != NULL) {
- isc_timer_detach(&xfr->timer);
+ isc_timer_destroy(&xfr->timer);
}
if (dns_name_dynamic(&xfr->name)) {
dns_name_free(&xfr->name, xfr->mctx);
@@ -1582,7 +1582,7 @@ maybe_free(dns_xfrin_ctx_t *xfr) {
}
if (xfr->timer != NULL) {
- isc_timer_detach(&xfr->timer);
+ isc_timer_destroy(&xfr->timer);
}
if (xfr->task != NULL) {
diff --git a/external/mpl/bind/dist/lib/dns/zone.c b/external/mpl/bind/dist/lib/dns/zone.c
index 57c2fa287de..c4690e08c7f 100644
--- a/external/mpl/bind/dist/lib/dns/zone.c
+++ b/external/mpl/bind/dist/lib/dns/zone.c
@@ -1,4 +1,4 @@
-/* $NetBSD: zone.c,v 1.17 2023/01/25 21:43:30 christos Exp $ */
+/* $NetBSD: zone.c,v 1.18 2023/06/26 22:03:00 christos Exp $ */
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
@@ -1259,6 +1259,8 @@ zone_free(dns_zone_t *zone) {
INSIST(zone->readio == NULL);
INSIST(zone->statelist == NULL);
INSIST(zone->writeio == NULL);
+ INSIST(zone->view == NULL);
+ INSIST(zone->prev_view == NULL);
if (zone->task != NULL) {
isc_task_detach(&zone->task);
@@ -1266,12 +1268,6 @@ zone_free(dns_zone_t *zone) {
if (zone->loadtask != NULL) {
isc_task_detach(&zone->loadtask);
}
- if (zone->view != NULL) {
- dns_view_weakdetach(&zone->view);
- }
- if (zone->prev_view != NULL) {
- dns_view_weakdetach(&zone->prev_view);
- }
/* Unmanaged objects */
while (!ISC_LIST_EMPTY(zone->setnsec3param_queue)) {
@@ -2421,6 +2417,9 @@ zone_asyncload(isc_task_t *task, isc_event_t *event) {
(asl->loaded)(asl->loaded_arg, zone, task);
}
+ /* Reduce the quantum */
+ isc_task_setquantum(zone->loadtask, 1);
+
isc_mem_put(zone->mctx, asl, sizeof(*asl));
dns_zone_idetach(&zone);
}
@@ -4744,8 +4743,7 @@ sync_keyzone(dns_zone_t *zone, dns_db_t *db) {
}
failure:
- if (result != ISC_R_SUCCESS && !DNS_ZONE_FLAG(zone, DNS_ZONEFLG_LOADED))
- {
+ if (result != ISC_R_SUCCESS) {
dnssec_log(zone, ISC_LOG_ERROR,
"unable to synchronize managed keys: %s",
dns_result_totext(result));
@@ -5210,10 +5208,7 @@ zone_postload(dns_zone_t *zone, dns_db_t *db, isc_time_t loadtime,
break;
case dns_zone_key:
- result = sync_keyzone(zone, db);
- if (result != ISC_R_SUCCESS) {
- goto cleanup;
- }
+ /* Nothing needs to be done now */
break;
default:
@@ -5371,13 +5366,6 @@ zone_postload(dns_zone_t *zone, dns_db_t *db, isc_time_t loadtime,
goto done;
cleanup:
- if (zone->type == dns_zone_key && result != ISC_R_SUCCESS) {
- dnssec_log(zone, ISC_LOG_ERROR,
- "failed to initialize managed-keys (%s): "
- "DNSSEC validation is at risk",
- isc_result_totext(result));
- }
-
if (result != ISC_R_SUCCESS) {
dns_zone_rpz_disable_db(zone, db);
dns_zone_catz_disable_db(zone, db);
@@ -5866,11 +5854,11 @@ dns_zone_setkasp(dns_zone_t *zone, dns_kasp_t *kasp) {
LOCK_ZONE(zone);
if (zone->kasp != NULL) {
- dns_kasp_t *oldkasp = zone->kasp;
- zone->kasp = NULL;
- dns_kasp_detach(&oldkasp);
+ dns_kasp_detach(&zone->kasp);
+ }
+ if (kasp != NULL) {
+ dns_kasp_attach(kasp, &zone->kasp);
}
- zone->kasp = kasp;
UNLOCK_ZONE(zone);
}
@@ -7361,8 +7349,14 @@ zone_resigninc(dns_zone_t *zone) {
}
ZONEDB_LOCK(&zone->dblock, isc_rwlocktype_read);
- dns_db_attach(zone->db, &db);
+ if (zone->db != NULL) {
+ dns_db_attach(zone->db, &db);
+ }
ZONEDB_UNLOCK(&zone->dblock, isc_rwlocktype_read);
+ if (db == NULL) {
+ result = ISC_R_FAILURE;
+ goto failure;
+ }
result = dns_db_newversion(db, &version);
if (result != ISC_R_SUCCESS) {
@@ -9624,14 +9618,14 @@ zone_sign(dns_zone_t *zone) {
use_kasp ? "yes" : "no");
/* Determine which type of chain to build */
- if (use_kasp) {
- build_nsec3 = dns_kasp_nsec3(kasp);
- build_nsec = !build_nsec3;
- } else {
- CHECK(dns_private_chains(db, version, zone->privatetype,
- &build_nsec, &build_nsec3));
- /* If neither chain is found, default to NSEC */
- if (!build_nsec && !build_nsec3) {
+ CHECK(dns_private_chains(db, version, zone->privatetype, &build_nsec,
+ &build_nsec3));
+ if (!build_nsec && !build_nsec3) {
+ if (use_kasp) {
+ build_nsec3 = dns_kasp_nsec3(kasp);
+ build_nsec = !build_nsec3;
+ } else {
+ /* If neither chain is found, default to NSEC */
build_nsec = true;
}
}
@@ -11064,6 +11058,11 @@ retry_keyfetch(dns_keyfetch_t *kfetch, dns_name_t *kname) {
isc_time_t timenow, timethen;
dns_zone_t *zone = kfetch->zone;
bool free_needed;
+ char namebuf[DNS_NAME_FORMATSIZE];
+
+ dns_name_format(kname, namebuf, sizeof(namebuf));
+ dnssec_log(zone, ISC_LOG_WARNING,
+ "Failed to create fetch for %s DNSKEY update", namebuf);
/*
* Error during a key fetch; cancel and retry in an hour.
@@ -11075,8 +11074,6 @@ retry_keyfetch(dns_keyfetch_t *kfetch, dns_name_t *kname) {
dns_rdataset_disassociate(&kfetch->keydataset);
dns_name_free(kname, zone->mctx);
isc_mem_putanddetach(&kfetch->mctx, kfetch, sizeof(*kfetch));
- dnssec_log(zone, ISC_LOG_WARNING,
- "Failed to create fetch for DNSKEY update");
if (!DNS_ZONE_FLAG(zone, DNS_ZONEFLG_EXITING)) {
/* Don't really retry if we are exiting */
@@ -14939,6 +14936,7 @@ zone_shutdown(isc_task_t *task, isc_event_t *event) {
dns_zone_t *zone = (dns_zone_t *)event->ev_arg;
bool free_needed, linked = false;
dns_zone_t *raw = NULL, *secure = NULL;
+ dns_view_t *view = NULL, *prev_view = NULL;
UNUSED(task);
REQUIRE(DNS_ZONE_VALID(zone));
@@ -14984,6 +14982,17 @@ zone_shutdown(isc_task_t *task, isc_event_t *event) {
LOCK_ZONE(zone);
INSIST(zone != zone->raw);
+
+ /*
+ * Detach the views early, we don't need them anymore. However, we need
+ * to detach them outside of the zone lock to break the lock loop
+ * between view, adb and zone locks.
+ */
+ view = zone->view;
+ zone->view = NULL;
+ prev_view = zone->prev_view;
+ zone->prev_view = NULL;
+
if (linked) {
isc_refcount_decrement(&zone->irefs);
}
@@ -15018,7 +15027,7 @@ zone_shutdown(isc_task_t *task, isc_event_t *event) {
forward_cancel(zone);
if (zone->timer != NULL) {
- isc_timer_detach(&zone->timer);
+ isc_timer_destroy(&zone->timer);
isc_refcount_decrement(&zone->irefs);
}
@@ -15044,6 +15053,14 @@ zone_shutdown(isc_task_t *task, isc_event_t *event) {
zone->secure = NULL;
}
UNLOCK_ZONE(zone);
+
+ if (view != NULL) {
+ dns_view_weakdetach(&view);
+ }
+ if (prev_view != NULL) {
+ dns_view_weakdetach(&prev_view);
+ }
+
if (raw != NULL) {
dns_zone_detach(&raw);
}
@@ -19075,7 +19092,7 @@ dns_zonemgr_setsize(dns_zonemgr_t *zmgr, int num_zones) {
pool = NULL;
if (zmgr->loadtasks == NULL) {
result = isc_taskpool_create(zmgr->taskmgr, zmgr->mctx, ntasks,
- 2, true, &pool);
+ UINT_MAX, true, &pool);
} else {
result = isc_taskpool_expand(&zmgr->loadtasks, ntasks, true,
&pool);
diff --git a/external/mpl/bind/dist/lib/irs/getaddrinfo.c b/external/mpl/bind/dist/lib/irs/getaddrinfo.c
index 4aa6d27830e..9990b618b9b 100644
--- a/external/mpl/bind/dist/lib/irs/getaddrinfo.c
+++ b/external/mpl/bind/dist/lib/irs/getaddrinfo.c
@@ -1,4 +1,4 @@
-/* $NetBSD: getaddrinfo.c,v 1.8 2023/01/25 21:43:31 christos Exp $ */
+/* $NetBSD: getaddrinfo.c,v 1.9 2023/06/26 22:03:01 christos Exp $ */
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
@@ -1358,7 +1358,8 @@ ai_concat(struct addrinfo *ai1, struct addrinfo *ai2) {
for (ai_tmp = ai1; ai_tmp != NULL && ai_tmp->ai_next != NULL;
ai_tmp = ai_tmp->ai_next)
- {}
+ {
+ }
ai_tmp->ai_next = ai2;
diff --git a/external/mpl/bind/dist/lib/irs/resconf.c b/external/mpl/bind/dist/lib/irs/resconf.c
index f8f1d6c9358..3e2eee5bd9b 100644
--- a/external/mpl/bind/dist/lib/irs/resconf.c
+++ b/external/mpl/bind/dist/lib/irs/resconf.c
@@ -1,4 +1,4 @@
-/* $NetBSD: resconf.c,v 1.6 2022/09/23 12:15:32 christos Exp $ */
+/* $NetBSD: resconf.c,v 1.7 2023/06/26 22:03:01 christos Exp $ */
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
@@ -290,10 +290,6 @@ resconf_parsenameserver(irs_resconf_t *conf, FILE *fp) {
int cp;
isc_result_t result;
- if (conf->numns == RESCONFMAXNAMESERVERS) {
- return (ISC_R_SUCCESS);
- }
-
cp = getword(fp, word, sizeof(word));
if (strlen(word) == 0U) {
return (ISC_R_UNEXPECTEDEND); /* Nothing on line. */
@@ -305,6 +301,10 @@ resconf_parsenameserver(irs_resconf_t *conf, FILE *fp) {
return (ISC_R_UNEXPECTEDTOKEN); /* Extra junk on line. */
}
+ if (conf->numns == RESCONFMAXNAMESERVERS) {
+ return (ISC_R_SUCCESS);
+ }
+
result = add_server(conf->mctx, word, &conf->nameservers);
if (result != ISC_R_SUCCESS) {
return (result);
diff --git a/external/mpl/bind/dist/lib/isc/include/isc/task.h b/external/mpl/bind/dist/lib/isc/include/isc/task.h
index 5e7aa9c7c18..19ad13244c1 100644
--- a/external/mpl/bind/dist/lib/isc/include/isc/task.h
+++ b/external/mpl/bind/dist/lib/isc/include/isc/task.h
@@ -1,4 +1,4 @@
-/* $NetBSD: task.h,v 1.7 2022/09/23 12:15:33 christos Exp $ */
+/* $NetBSD: task.h,v 1.8 2023/06/26 22:03:01 christos Exp $ */
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
@@ -375,27 +375,27 @@ isc_task_unsend(isc_task_t *task, void *sender, isc_eventtype_t type, void *tag,
*
* Notes:
*
- *\li This function is equivalent to
+ *\li This function is equivalent to
*
*\code
- * isc_task_unsendrange(task, sender, type, type, tag, events);
+ * isc_task_unsendrange(task, sender, type, type, tag, events);
*\endcode
*
* Requires:
*
- *\li 'task' is a valid task.
+ *\li 'task' is a valid task.
*
- *\li *events is a valid list.
+ *\li *events is a valid list.
*
* Ensures:
*
- *\li Events in the event queue of 'task' whose sender is 'sender', whose
- * type is 'type', and whose tag is 'tag' will be dequeued and appended
- * to *events.
+ *\li Events in the event queue of 'task' whose sender is 'sender', whose
+ * type is 'type', and whose tag is 'tag' will be dequeued and appended
+ * to *events.
*
* Returns:
*
- *\li The number of events unsent.
+ *\li The number of events unsent.
*/
isc_result_t
@@ -530,6 +530,15 @@ isc_task_gettag(isc_task_t *task);
*\li 'task' is a valid task.
*/
+void
+isc_task_setquantum(isc_task_t *task, unsigned int quantum);
+/*%<
+ * Set future 'task' quantum to 'quantum'. The current 'task' quantum will be
+ * kept for the current isc_task_run() loop, and will be changed for the next
+ * run. Therefore, the function is safe to use from the event callback as it
+ * will not affect the current event loop processing.
+ */
+
isc_result_t
isc_task_beginexclusive(isc_task_t *task);
/*%<
diff --git a/external/mpl/bind/dist/lib/isc/include/isc/timer.h b/external/mpl/bind/dist/lib/isc/include/isc/timer.h
index c6737df9e34..9428f1d9f1d 100644
--- a/external/mpl/bind/dist/lib/isc/include/isc/timer.h
+++ b/external/mpl/bind/dist/lib/isc/include/isc/timer.h
@@ -1,4 +1,4 @@
-/* $NetBSD: timer.h,v 1.7 2022/09/23 12:15:33 christos Exp $ */
+/* $NetBSD: timer.h,v 1.8 2023/06/26 22:03:01 christos Exp $ */
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
@@ -90,10 +90,13 @@ typedef enum {
isc_timertype_inactive = 3 /*%< Inactive */
} isc_timertype_t;
-typedef struct isc_timerevent {
+typedef struct isc_timerevent isc_timerevent_t;
+
+struct isc_timerevent {
struct isc_event common;
isc_time_t due;
-} isc_timerevent_t;
+ ISC_LINK(isc_timerevent_t) ev_timerlink;
+};
#define ISC_TIMEREVENT_FIRSTEVENT (ISC_EVENTCLASS_TIMER + 0)
#define ISC_TIMEREVENT_TICK (ISC_EVENTCLASS_TIMER + 1)
@@ -225,25 +228,9 @@ isc_timer_touch(isc_timer_t *timer);
*/
void
-isc_timer_attach(isc_timer_t *timer, isc_timer_t **timerp);
-/*%<
- * Attach *timerp to timer.
- *
- * Requires:
- *
- *\li 'timer' is a valid timer.
- *
- *\li 'timerp' points to a NULL timer.
- *
- * Ensures:
- *
- *\li *timerp is attached to timer.
- */
-
-void
-isc_timer_detach(isc_timer_t **timerp);
+isc_timer_destroy(isc_timer_t **timerp);
/*%<
- * Detach *timerp from its timer.
+ * Destroy *timerp.
*
* Requires:
*
@@ -253,9 +240,6 @@ isc_timer_detach(isc_timer_t **timerp);
*
*\li *timerp is NULL.
*
- *\li If '*timerp' is the last reference to the timer,
- * then:
- *
*\code
* The timer will be shutdown
*
@@ -264,9 +248,13 @@ isc_timer_detach(isc_timer_t **timerp);
* All resources used by the timer have been freed
*
* Any events already posted by the timer will be purged.
- * Therefore, if isc_timer_detach() is called in the context
+ * Therefore, if isc_timer_destroy() is called in the context
* of the timer's task, it is guaranteed that no more
* timer event callbacks will run after the call.
+ *
+ * If this function is called from the timer event callback
+ * the event itself must be destroyed before the timer
+ * itself.
*\endcode
*/
diff --git a/external/mpl/bind/dist/lib/isc/iterated_hash.c b/external/mpl/bind/dist/lib/isc/iterated_hash.c
index f8f83910bfc..3a1c41e71d6 100644
--- a/external/mpl/bind/dist/lib/isc/iterated_hash.c
+++ b/external/mpl/bind/dist/lib/isc/iterated_hash.c
@@ -1,4 +1,4 @@
-/* $NetBSD: iterated_hash.c,v 1.6 2022/09/23 12:15:33 christos Exp $ */
+/* $NetBSD: iterated_hash.c,v 1.7 2023/06/26 22:03:01 christos Exp $ */
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
@@ -15,8 +15,11 @@
#include <stdio.h>
+#include <openssl/opensslv.h>
+#include <openssl/sha.h>
+
#include <isc/iterated_hash.h>
-#include <isc/md.h>
+#include <isc/thread.h>
#include <isc/util.h>
int
@@ -24,55 +27,40 @@ isc_iterated_hash(unsigned char *out, const unsigned int hashalg,
const int iterations, const unsigned char *salt,
const int saltlength, const unsigned char *in,
const int inlength) {
- isc_md_t *md;
- isc_result_t result;
+ REQUIRE(out != NULL);
+
int n = 0;
- unsigned int outlength = 0;
size_t len;
const unsigned char *buf;
-
- REQUIRE(out != NULL);
+ SHA_CTX ctx;
if (hashalg != 1) {
return (0);
}
- if ((md = isc_md_new()) == NULL) {
- return (0);
- }
-
- len = inlength;
buf = in;
+ len = inlength;
+
do {
- result = isc_md_init(md, ISC_MD_SHA1);
- if (result != ISC_R_SUCCESS) {
- goto md_fail;
+ if (SHA1_Init(&ctx) != 1) {
+ return (0);
}
- result = isc_md_update(md, buf, len);
- if (result != ISC_R_SUCCESS) {
- goto md_fail;
- }
- result = isc_md_update(md, salt, saltlength);
- if (result != ISC_R_SUCCESS) {
- goto md_fail;
+
+ if (SHA1_Update(&ctx, buf, len) != 1) {
+ return (0);
}
- result = isc_md_final(md, out, &outlength);
- if (result != ISC_R_SUCCESS) {
- goto md_fail;
+
+ if (SHA1_Update(&ctx, salt, saltlength) != 1) {
+ return (0);
}
- result = isc_md_reset(md);
- if (result != ISC_R_SUCCESS) {
- goto md_fail;
+
+ if (SHA1_Final(out, &ctx) != 1) {
+ return (0);
}
+
buf = out;
- len = outlength;
+ len = SHA_DIGEST_LENGTH;
} while (n++ < iterations);
- isc_md_free(md);
-
- return (outlength);
-md_fail:
- isc_md_free(md);
- return (0);
+ return (SHA_DIGEST_LENGTH);
}
-#undef RETERR
diff --git a/external/mpl/bind/dist/lib/isc/lib.c b/external/mpl/bind/dist/lib/isc/lib.c
index c7ae78d807a..a292064ddb4 100644
--- a/external/mpl/bind/dist/lib/isc/lib.c
+++ b/external/mpl/bind/dist/lib/isc/lib.c
@@ -1,4 +1,4 @@
-/* $NetBSD: lib.c,v 1.9 2022/09/23 12:15:33 christos Exp $ */
+/* $NetBSD: lib.c,v 1.10 2023/06/26 22:03:01 christos Exp $ */
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
@@ -16,6 +16,7 @@
/*! \file */
#include <isc/bind9.h>
+#include <isc/iterated_hash.h>
#include <isc/lib.h>
#include <isc/mem.h>
#include <isc/util.h>
diff --git a/external/mpl/bind/dist/lib/isc/log.c b/external/mpl/bind/dist/lib/isc/log.c
index a5e4a50e071..468cef1b1db 100644
--- a/external/mpl/bind/dist/lib/isc/log.c
+++ b/external/mpl/bind/dist/lib/isc/log.c
@@ -1,4 +1,4 @@
-/* $NetBSD: log.c,v 1.8 2023/01/25 21:43:31 christos Exp $ */
+/* $NetBSD: log.c,v 1.9 2023/06/26 22:03:01 christos Exp $ */
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
@@ -1105,7 +1105,7 @@ greatest_version(isc_logfile_t *file, int versions, int *greatestp) {
}
static void
-insert_sort(int64_t to_keep[], int64_t versions, int version) {
+insert_sort(int64_t to_keep[], int64_t versions, int64_t version) {
int i = 0;
while (i < versions && version < to_keep[i]) {
i++;
@@ -1122,12 +1122,13 @@ insert_sort(int64_t to_keep[], int64_t versions, int version) {
static int64_t
last_to_keep(int64_t versions, isc_dir_t *dirp, char *bname, size_t bnamelen) {
+ int64_t to_keep[ISC_LOG_MAX_VERSIONS] = { 0 };
+ int64_t version = 0;
+
if (versions <= 0) {
- return INT64_MAX;
+ return (INT64_MAX);
}
- int64_t to_keep[ISC_LOG_MAX_VERSIONS] = { 0 };
- int64_t version = 0;
if (versions > ISC_LOG_MAX_VERSIONS) {
versions = ISC_LOG_MAX_VERSIONS;
}
@@ -1136,6 +1137,9 @@ last_to_keep(int64_t versions, isc_dir_t *dirp, char *bname, size_t bnamelen) {
*/
memset(to_keep, 0, sizeof(to_keep));
while (isc_dir_read(dirp) == ISC_R_SUCCESS) {
+ char *digit_end = NULL;
+ char *ename = NULL;
+
if (dirp->entry.length <= bnamelen ||
strncmp(dirp->entry.name, bname, bnamelen) != 0 ||
dirp->entry.name[bnamelen] != '.')
@@ -1143,8 +1147,7 @@ last_to_keep(int64_t versions, isc_dir_t *dirp, char *bname, size_t bnamelen) {
continue;
}
- char *digit_end;
- char *ename = &dirp->entry.name[bnamelen + 1];
+ ename = &dirp->entry.name[bnamelen + 1];
version = strtoull(ename, &digit_end, 10);
if (*digit_end == '\0') {
insert_sort(to_keep, versions, version);
@@ -1162,8 +1165,8 @@ last_to_keep(int64_t versions, isc_dir_t *dirp, char *bname, size_t bnamelen) {
static isc_result_t
remove_old_tsversions(isc_logfile_t *file, int versions) {
isc_result_t result;
- char *bname, *digit_end;
- const char *dirname;
+ char *bname = NULL, *digit_end = NULL;
+ const char *dirname = NULL;
int64_t version, last = INT64_MAX;
size_t bnamelen;
isc_dir_t dir;
diff --git a/external/mpl/bind/dist/lib/isc/mem.c b/external/mpl/bind/dist/lib/isc/mem.c
index bbbe329fb72..1813de183bb 100644
--- a/external/mpl/bind/dist/lib/isc/mem.c
+++ b/external/mpl/bind/dist/lib/isc/mem.c
@@ -1,4 +1,4 @@
-/* $NetBSD: mem.c,v 1.13 2023/01/25 21:43:31 christos Exp $ */
+/* $NetBSD: mem.c,v 1.14 2023/06/26 22:03:01 christos Exp $ */
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
@@ -60,9 +60,10 @@ LIBISC_EXTERNAL_DATA unsigned int isc_mem_defaultflags = ISC_MEMFLAG_DEFAULT;
* Constants.
*/
-#define DEF_MAX_SIZE 1100
-#define DEF_MEM_TARGET 4096
-#define ALIGNMENT_SIZE 8U /*%< must be a power of 2 */
+#define DEF_MAX_SIZE 1100
+#define DEF_MEM_TARGET 4096
+#define ALIGNMENT_SIZE \
+ 8U /*%< must be a power of 2, also update lib/dns/rbt.c */
#define NUM_BASIC_BLOCKS 64 /*%< must be > 1 */
#define TABLE_INCREMENT 1024
#define DEBUG_TABLE_COUNT 512U
diff --git a/external/mpl/bind/dist/lib/isc/netmgr/netmgr.c b/external/mpl/bind/dist/lib/isc/netmgr/netmgr.c
index b2b8a9cc2da..a20236d6187 100644
--- a/external/mpl/bind/dist/lib/isc/netmgr/netmgr.c
+++ b/external/mpl/bind/dist/lib/isc/netmgr/netmgr.c
@@ -1,4 +1,4 @@
-/* $NetBSD: netmgr.c,v 1.9 2023/01/25 21:43:31 christos Exp $ */
+/* $NetBSD: netmgr.c,v 1.10 2023/06/26 22:03:01 christos Exp $ */
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
@@ -243,15 +243,15 @@ isc__nm_threadpool_initialize(uint32_t workers) {
}
}
-#if HAVE_DECL_UV_UDP_LINUX_RECVERR
-#define MINIMAL_UV_VERSION UV_VERSION(1, 42, 0)
-#elif HAVE_DECL_UV_UDP_MMSG_FREE
+#if HAVE_DECL_UV_UDP_MMSG_FREE
#define MINIMAL_UV_VERSION UV_VERSION(1, 40, 0)
#elif HAVE_DECL_UV_UDP_RECVMMSG
+#define MAXIMAL_UV_VERSION UV_VERSION(1, 39, 99)
#define MINIMAL_UV_VERSION UV_VERSION(1, 37, 0)
-#elif HAVE_DECL_UV_UDP_MMSG_CHUNK
-#define MINIMAL_UV_VERSION UV_VERSION(1, 35, 0)
+#elif _WIN32
+#define MINIMAL_UV_VERSION UV_VERSION(1, 0, 0)
#else
+#define MAXIMAL_UV_VERSION UV_VERSION(1, 34, 99)
#define MINIMAL_UV_VERSION UV_VERSION(1, 0, 0)
#endif
@@ -262,11 +262,21 @@ isc__netmgr_create(isc_mem_t *mctx, uint32_t workers, isc_nm_t **netmgrp) {
REQUIRE(workers > 0);
+#ifdef MAXIMAL_UV_VERSION
+ if (uv_version() > MAXIMAL_UV_VERSION) {
+ isc_error_fatal(__FILE__, __LINE__,
+ "libuv version too new: running with libuv %s "
+ "when compiled with libuv %s will lead to "
+ "libuv failures",
+ uv_version_string(), UV_VERSION_STRING);
+ }
+#endif /* MAXIMAL_UV_VERSION */
+
if (uv_version() < MINIMAL_UV_VERSION) {
isc_error_fatal(__FILE__, __LINE__,
"libuv version too old: running with libuv %s "
"when compiled with libuv %s will lead to "
- "libuv failures because of unknown flags",
+ "libuv failures",
uv_version_string(), UV_VERSION_STRING);
}
diff --git a/external/mpl/bind/dist/lib/isc/ratelimiter.c b/external/mpl/bind/dist/lib/isc/ratelimiter.c
index cfd920e51b2..73c29ef834d 100644
--- a/external/mpl/bind/dist/lib/isc/ratelimiter.c
+++ b/external/mpl/bind/dist/lib/isc/ratelimiter.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ratelimiter.c,v 1.7 2022/09/23 12:15:33 christos Exp $ */
+/* $NetBSD: ratelimiter.c,v 1.8 2023/06/26 22:03:01 christos Exp $ */
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
@@ -244,6 +244,7 @@ void
isc_ratelimiter_shutdown(isc_ratelimiter_t *rl) {
isc_event_t *ev;
isc_task_t *task;
+ isc_result_t result;
REQUIRE(rl != NULL);
@@ -259,7 +260,11 @@ isc_ratelimiter_shutdown(isc_ratelimiter_t *rl) {
}
task = NULL;
isc_task_attach(rl->task, &task);
- isc_timer_detach(&rl->timer);
+
+ result = isc_timer_reset(rl->timer, isc_timertype_inactive, NULL, NULL,
+ false);
+ RUNTIME_CHECK(result == ISC_R_SUCCESS);
+ isc_timer_destroy(&rl->timer);
/*
* Send an event to our task. The delivery of this event
diff --git a/external/mpl/bind/dist/lib/isc/task.c b/external/mpl/bind/dist/lib/isc/task.c
index 339170e3707..c591d3c517a 100644
--- a/external/mpl/bind/dist/lib/isc/task.c
+++ b/external/mpl/bind/dist/lib/isc/task.c
@@ -1,4 +1,4 @@
-/* $NetBSD: task.c,v 1.17 2023/01/25 21:43:31 christos Exp $ */
+/* $NetBSD: task.c,v 1.18 2023/06/26 22:03:01 christos Exp $ */
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
@@ -622,12 +622,10 @@ isc_task_purge(isc_task_t *task, void *sender, isc_eventtype_t type,
bool
isc_task_purgeevent(isc_task_t *task, isc_event_t *event) {
- isc_event_t *curr_event, *next_event;
+ bool found = false;
/*
* Purge 'event' from a task's event queue.
- *
- * XXXRTH: WARNING: This method may be removed before beta.
*/
REQUIRE(VALID_TASK(task));
@@ -643,23 +641,18 @@ isc_task_purgeevent(isc_task_t *task, isc_event_t *event) {
*/
LOCK(&task->lock);
- for (curr_event = HEAD(task->events); curr_event != NULL;
- curr_event = next_event)
- {
- next_event = NEXT(curr_event, ev_link);
- if (curr_event == event && PURGE_OK(event)) {
- DEQUEUE(task->events, curr_event, ev_link);
- task->nevents--;
- break;
- }
+ if (ISC_LINK_LINKED(event, ev_link)) {
+ DEQUEUE(task->events, event, ev_link);
+ task->nevents--;
+ found = true;
}
UNLOCK(&task->lock);
- if (curr_event == NULL) {
+ if (!found) {
return (false);
}
- isc_event_free(&curr_event);
+ isc_event_free(&event);
return (true);
}
@@ -809,6 +802,16 @@ isc_task_getnetmgr(isc_task_t *task) {
return (task->manager->netmgr);
}
+void
+isc_task_setquantum(isc_task_t *task, unsigned int quantum) {
+ REQUIRE(VALID_TASK(task));
+
+ LOCK(&task->lock);
+ task->quantum = (quantum > 0) ? quantum
+ : task->manager->default_quantum;
+ UNLOCK(&task->lock);
+}
+
/***
*** Task Manager.
***/
@@ -819,10 +822,13 @@ task_run(isc_task_t *task) {
bool finished = false;
isc_event_t *event = NULL;
isc_result_t result = ISC_R_SUCCESS;
+ uint32_t quantum;
REQUIRE(VALID_TASK(task));
LOCK(&task->lock);
+ quantum = task->quantum;
+
/*
* It is possible because that we have a paused task in the queue - it
* might have been paused in the meantime and we never hold both queue
@@ -914,7 +920,7 @@ task_run(isc_task_t *task) {
XTRACE("pausing");
task->state = task_state_paused;
break;
- } else if (dispatch_count >= task->quantum) {
+ } else if (dispatch_count >= quantum) {
/*
* Our quantum has expired, but there is more work to be
* done. We'll requeue it to the ready queue later.
diff --git a/external/mpl/bind/dist/lib/isc/tests/task_test.c b/external/mpl/bind/dist/lib/isc/tests/task_test.c
index 180e979f192..65fb6779d80 100644
--- a/external/mpl/bind/dist/lib/isc/tests/task_test.c
+++ b/external/mpl/bind/dist/lib/isc/tests/task_test.c
@@ -1,4 +1,4 @@
-/* $NetBSD: task_test.c,v 1.11 2023/01/25 21:43:31 christos Exp $ */
+/* $NetBSD: task_test.c,v 1.12 2023/06/26 22:03:01 christos Exp $ */
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
@@ -633,8 +633,8 @@ basic(void **state) {
#else /* ifndef WIN32 */
Sleep(10000);
#endif /* ifndef WIN32 */
- isc_timer_detach(&ti1);
- isc_timer_detach(&ti2);
+ isc_timer_destroy(&ti1);
+ isc_timer_destroy(&ti2);
}
/*
@@ -1521,20 +1521,6 @@ purgeevent(void **state) {
try_purgeevent(true);
}
-/*
- * Purge event not purgeable test:
- * When the event is not marked as purgable, a call to
- * isc_task_purgeevent(task, event) does not purge the event
- * 'event' from the task's queue and returns false.
- */
-
-static void
-purgeevent_notpurge(void **state) {
- UNUSED(state);
-
- try_purgeevent(false);
-}
-
int
main(int argc, char **argv) {
const struct CMUnitTest tests[] = {
@@ -1552,8 +1538,6 @@ main(int argc, char **argv) {
_teardown),
cmocka_unit_test_setup_teardown(purge, _setup2, _teardown),
cmocka_unit_test_setup_teardown(purgeevent, _setup2, _teardown),
- cmocka_unit_test_setup_teardown(purgeevent_notpurge, _setup,
- _teardown),
cmocka_unit_test_setup_teardown(purgerange, _setup, _teardown),
cmocka_unit_test_setup_teardown(task_shutdown, _setup4,
_teardown),
diff --git a/external/mpl/bind/dist/lib/isc/tests/timer_test.c b/external/mpl/bind/dist/lib/isc/tests/timer_test.c
index be11e5c001d..b3e5a89b51a 100644
--- a/external/mpl/bind/dist/lib/isc/tests/timer_test.c
+++ b/external/mpl/bind/dist/lib/isc/tests/timer_test.c
@@ -1,4 +1,4 @@
-/* $NetBSD: timer_test.c,v 1.9 2022/09/23 12:15:34 christos Exp $ */
+/* $NetBSD: timer_test.c,v 1.10 2023/06/26 22:03:01 christos Exp $ */
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
@@ -246,14 +246,14 @@ ticktock(isc_task_t *task, isc_event_t *event) {
isc_mutex_unlock(&lasttime_mx);
subthread_assert_result_equal(result, ISC_R_SUCCESS);
+ isc_event_free(&event);
+
if (atomic_load(&eventcnt) == nevents) {
result = isc_time_now(&endtime);
subthread_assert_result_equal(result, ISC_R_SUCCESS);
- isc_timer_detach(&timer);
+ isc_timer_destroy(&timer);
isc_task_shutdown(task);
}
-
- isc_event_free(&event);
}
/*
@@ -341,9 +341,10 @@ test_idle(isc_task_t *task, isc_event_t *event) {
subthread_assert_int_equal(event->ev_type, ISC_TIMEREVENT_IDLE);
- isc_timer_detach(&timer);
- isc_task_shutdown(task);
isc_event_free(&event);
+
+ isc_timer_destroy(&timer);
+ isc_task_shutdown(task);
}
/* timer type once idles out */
@@ -428,14 +429,15 @@ test_reset(isc_task_t *task, isc_event_t *event) {
&expires, &interval, false);
subthread_assert_result_equal(result, ISC_R_SUCCESS);
}
+
+ isc_event_free(&event);
} else {
subthread_assert_int_equal(event->ev_type, ISC_TIMEREVENT_LIFE);
- isc_timer_detach(&timer);
+ isc_event_free(&event);
+ isc_timer_destroy(&timer);
isc_task_shutdown(task);
}
-
- isc_event_free(&event);
}
static void
@@ -593,8 +595,8 @@ purge(void **state) {
assert_int_equal(atomic_load(&eventcnt), 1);
- isc_timer_detach(&tickertimer);
- isc_timer_detach(&oncetimer);
+ isc_timer_destroy(&tickertimer);
+ isc_timer_destroy(&oncetimer);
isc_task_destroy(&task1);
isc_task_destroy(&task2);
}
diff --git a/external/mpl/bind/dist/lib/isc/timer.c b/external/mpl/bind/dist/lib/isc/timer.c
index e55aca6245b..198e8813bf9 100644
--- a/external/mpl/bind/dist/lib/isc/timer.c
+++ b/external/mpl/bind/dist/lib/isc/timer.c
@@ -1,4 +1,4 @@
-/* $NetBSD: timer.c,v 1.11 2023/01/25 21:43:31 christos Exp $ */
+/* $NetBSD: timer.c,v 1.12 2023/06/26 22:03:01 christos Exp $ */
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
@@ -64,9 +64,9 @@ struct isc_timer {
unsigned int magic;
isc_timermgr_t *manager;
isc_mutex_t lock;
- isc_refcount_t references;
/*! Locked by timer lock. */
isc_time_t idle;
+ ISC_LIST(isc_timerevent_t) active;
/*! Locked by manager lock. */
isc_timertype_t type;
isc_time_t expires;
@@ -210,26 +210,36 @@ deschedule(isc_timer_t *timer) {
}
static void
-destroy(isc_timer_t *timer) {
- isc_timermgr_t *manager = timer->manager;
-
- /*
- * The caller must ensure it is safe to destroy the timer.
- */
+timerevent_unlink(isc_timer_t *timer, isc_timerevent_t *event) {
+ REQUIRE(ISC_LINK_LINKED(event, ev_timerlink));
+ ISC_LIST_UNLINK(timer->active, event, ev_timerlink);
+}
- LOCK(&manager->lock);
+static void
+timerevent_destroy(isc_event_t *event0) {
+ isc_timer_t *timer = event0->ev_destroy_arg;
+ isc_timerevent_t *event = (isc_timerevent_t *)event0;
- (void)isc_task_purgerange(timer->task, timer, ISC_TIMEREVENT_FIRSTEVENT,
- ISC_TIMEREVENT_LASTEVENT, NULL);
- deschedule(timer);
- UNLINK(manager->timers, timer, link);
+ LOCK(&timer->lock);
+ if (ISC_LINK_LINKED(event, ev_timerlink)) {
+ /* The event was unlinked via timer_purge() */
+ timerevent_unlink(timer, event);
+ }
+ UNLOCK(&timer->lock);
- UNLOCK(&manager->lock);
+ isc_mem_put(timer->manager->mctx, event, event0->ev_size);
+}
- isc_task_detach(&timer->task);
- isc_mutex_destroy(&timer->lock);
- timer->magic = 0;
- isc_mem_put(manager->mctx, timer, sizeof(*timer));
+static void
+timer_purge(isc_timer_t *timer) {
+ isc_timerevent_t *event = NULL;
+
+ while ((event = ISC_LIST_HEAD(timer->active)) != NULL) {
+ timerevent_unlink(timer, event);
+ UNLOCK(&timer->lock);
+ (void)isc_task_purgeevent(timer->task, (isc_event_t *)event);
+ LOCK(&timer->lock);
+ }
}
isc_result_t
@@ -281,7 +291,6 @@ isc_timer_create(isc_timermgr_t *manager, isc_timertype_t type,
timer = isc_mem_get(manager->mctx, sizeof(*timer));
timer->manager = manager;
- isc_refcount_init(&timer->references, 1);
if (type == isc_timertype_once && !isc_interval_iszero(interval)) {
result = isc_time_add(&now, interval, &timer->idle);
@@ -313,6 +322,9 @@ isc_timer_create(isc_timermgr_t *manager, isc_timertype_t type,
timer->index = 0;
isc_mutex_init(&timer->lock);
ISC_LINK_INIT(timer, link);
+
+ ISC_LIST_INIT(timer->active);
+
timer->magic = TIMER_MAGIC;
LOCK(&manager->lock);
@@ -392,9 +404,7 @@ isc_timer_reset(isc_timer_t *timer, isc_timertype_t type,
LOCK(&timer->lock);
if (purge) {
- (void)isc_task_purgerange(timer->task, timer,
- ISC_TIMEREVENT_FIRSTEVENT,
- ISC_TIMEREVENT_LASTEVENT, NULL);
+ timer_purge(timer);
}
timer->type = type;
timer->expires = *expires;
@@ -465,41 +475,60 @@ isc_timer_touch(isc_timer_t *timer) {
}
void
-isc_timer_attach(isc_timer_t *timer, isc_timer_t **timerp) {
- /*
- * Attach *timerp to timer.
- */
+isc_timer_destroy(isc_timer_t **timerp) {
+ isc_timer_t *timer = NULL;
+ isc_timermgr_t *manager = NULL;
- REQUIRE(VALID_TIMER(timer));
- REQUIRE(timerp != NULL && *timerp == NULL);
- isc_refcount_increment(&timer->references);
+ REQUIRE(timerp != NULL && VALID_TIMER(*timerp));
+
+ timer = *timerp;
+ *timerp = NULL;
- *timerp = timer;
+ manager = timer->manager;
+
+ LOCK(&manager->lock);
+
+ LOCK(&timer->lock);
+ timer_purge(timer);
+ deschedule(timer);
+ UNLOCK(&timer->lock);
+
+ UNLINK(manager->timers, timer, link);
+
+ UNLOCK(&manager->lock);
+
+ isc_task_detach(&timer->task);
+ isc_mutex_destroy(&timer->lock);
+ timer->magic = 0;
+ isc_mem_put(manager->mctx, timer, sizeof(*timer));
}
-void
-isc_timer_detach(isc_timer_t **timerp) {
- isc_timer_t *timer;
+static void
+timer_post_event(isc_timermgr_t *manager, isc_timer_t *timer,
+ isc_eventtype_t type) {
+ isc_timerevent_t *event;
+ XTRACEID("posting", timer);
- /*
- * Detach *timerp from its timer.
- */
+ event = (isc_timerevent_t *)isc_event_allocate(
+ manager->mctx, timer, type, timer->action, timer->arg,
+ sizeof(*event));
- REQUIRE(timerp != NULL);
- timer = *timerp;
- REQUIRE(VALID_TIMER(timer));
+ ISC_LINK_INIT(event, ev_timerlink);
+ ((isc_event_t *)event)->ev_destroy = timerevent_destroy;
+ ((isc_event_t *)event)->ev_destroy_arg = timer;
- if (isc_refcount_decrement(&timer->references) == 1) {
- destroy(timer);
- }
+ event->due = timer->due;
- *timerp = NULL;
+ LOCK(&timer->lock);
+ ISC_LIST_APPEND(timer->active, event, ev_timerlink);
+ UNLOCK(&timer->lock);
+
+ isc_task_send(timer->task, ISC_EVENT_PTR(&event));
}
static void
dispatch(isc_timermgr_t *manager, isc_time_t *now) {
bool done = false, post_event, need_schedule;
- isc_timerevent_t *event;
isc_eventtype_t type = 0;
isc_timer_t *timer;
isc_result_t result;
@@ -561,25 +590,7 @@ dispatch(isc_timermgr_t *manager, isc_time_t *now) {
}
if (post_event) {
- XTRACEID("posting", timer);
- /*
- * XXX We could preallocate this event.
- */
- event = (isc_timerevent_t *)isc_event_allocate(
- manager->mctx, timer, type,
- timer->action, timer->arg,
- sizeof(*event));
-
- if (event != NULL) {
- event->due = timer->due;
- isc_task_send(timer->task,
- ISC_EVENT_PTR(&event));
- } else {
- UNEXPECTED_ERROR(__FILE__, __LINE__,
- "%s",
- "couldn't allocate "
- "event");
- }
+ timer_post_event(manager, timer, type);
}
timer->index = 0;
diff --git a/external/mpl/bind/dist/lib/ns/query.c b/external/mpl/bind/dist/lib/ns/query.c
index 2b81df21285..dcceef6351d 100644
--- a/external/mpl/bind/dist/lib/ns/query.c
+++ b/external/mpl/bind/dist/lib/ns/query.c
@@ -1,4 +1,4 @@
-/* $NetBSD: query.c,v 1.16 2023/01/25 21:43:32 christos Exp $ */
+/* $NetBSD: query.c,v 1.17 2023/06/26 22:03:01 christos Exp $ */
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
@@ -5726,6 +5726,7 @@ query_refresh_rrset(query_ctx_t *orig_qctx) {
qctx.client->query.dboptions &= ~(DNS_DBFIND_STALETIMEOUT |
DNS_DBFIND_STALEOK |
DNS_DBFIND_STALEENABLED);
+ qctx.client->nodetach = false;
/*
* We'll need some resources...
@@ -5752,6 +5753,27 @@ query_refresh_rrset(query_ctx_t *orig_qctx) {
}
/*%
+ * Depending on the db lookup result, we can respond to the
+ * client this stale answer.
+ */
+static bool
+stale_client_answer(isc_result_t result) {
+ switch (result) {
+ case ISC_R_SUCCESS:
+ case DNS_R_EMPTYNAME:
+ case DNS_R_NXRRSET:
+ case DNS_R_NCACHENXRRSET:
+ case DNS_R_CNAME:
+ case DNS_R_DNAME:
+ return (true);
+ default:
+ return (false);
+ }
+
+ UNREACHABLE();
+}
+
+/*%
* Perform a local database lookup, in either an authoritative or
* cache database. If unable to answer, call ns_query_done(); otherwise
* hand off processing to query_gotanswer().
@@ -5880,7 +5902,6 @@ query_lookup(query_ctx_t *qctx) {
{
/* Found non-stale usable rdataset. */
answer_found = true;
- goto gotanswer;
}
if (dbfind_stale || stale_refresh_window || stale_timeout) {
@@ -5906,7 +5927,7 @@ query_lookup(query_ctx_t *qctx) {
NS_LOGMODULE_QUERY, ISC_LOG_INFO,
"%s resolver failure, stale answer %s", namebuf,
stale_found ? "used" : "unavailable");
- if (!stale_found) {
+ if (!stale_found && !answer_found) {
/*
* Resolver failure, no stale data, nothing more we
* can do, return SERVFAIL.
@@ -5925,7 +5946,7 @@ query_lookup(query_ctx_t *qctx) {
"answer %s",
namebuf, stale_found ? "used" : "unavailable");
- if (!stale_found) {
+ if (!stale_found && !answer_found) {
/*
* During the stale refresh window explicitly do not try
* to refresh the data, because a recent lookup failed.
@@ -5935,7 +5956,7 @@ query_lookup(query_ctx_t *qctx) {
}
} else if (stale_timeout) {
if ((qctx->options & DNS_GETDB_STALEFIRST) != 0) {
- if (!stale_found) {
+ if (!stale_found && !answer_found) {
/*
* We have nothing useful in cache to return
* immediately.
@@ -5952,7 +5973,7 @@ query_lookup(query_ctx_t *qctx) {
&qctx->client->query.fetch);
}
return (query_lookup(qctx));
- } else {
+ } else if (stale_client_answer(result)) {
/*
* Immediately return the stale answer, start a
* resolver fetch to refresh the data in cache.
@@ -5963,7 +5984,14 @@ query_lookup(query_ctx_t *qctx) {
"%s stale answer used, an attempt to "
"refresh the RRset will still be made",
namebuf);
+
qctx->refresh_rrset = STALE(qctx->rdataset);
+
+ /*
+ * If we are refreshing the RRSet, we must not
+ * detach from the client in query_send().
+ */
+ qctx->client->nodetach = qctx->refresh_rrset;
}
} else {
/*
@@ -5976,7 +6004,11 @@ query_lookup(query_ctx_t *qctx) {
"%s client timeout, stale answer %s",
namebuf,
stale_found ? "used" : "unavailable");
- if (!stale_found) {
+ if (!stale_found && !answer_found) {
+ return (result);
+ }
+
+ if (!stale_client_answer(result)) {
return (result);
}
@@ -5989,7 +6021,6 @@ query_lookup(query_ctx_t *qctx) {
}
}
-gotanswer:
if (stale_timeout && (answer_found || stale_found)) {
/*
* Mark RRsets that we are adding to the client message on a
@@ -6308,7 +6339,7 @@ ns_query_recurse(ns_client_t *client, dns_rdatatype_t qtype, dns_name_t *qname,
if (recparam_match(&client->query.recparam, qtype, qname, qdomain)) {
ns_client_log(client, NS_LOGCATEGORY_CLIENT, NS_LOGMODULE_QUERY,
ISC_LOG_INFO, "recursion loop detected");
- return (ISC_R_FAILURE);
+ return (ISC_R_ALREADYRUNNING);
}
recparam_update(&client->query.recparam, qtype, qname, qdomain);
@@ -7272,10 +7303,21 @@ query_usestale(query_ctx_t *qctx, isc_result_t result) {
return (false);
}
- if (result == DNS_R_DUPLICATE || result == DNS_R_DROP) {
+ if (qctx->refresh_rrset) {
+ /*
+ * This is a refreshing query, we have already prioritized
+ * stale data, so don't enable serve-stale again.
+ */
+ return (false);
+ }
+
+ if (result == DNS_R_DUPLICATE || result == DNS_R_DROP ||
+ result == ISC_R_ALREADYRUNNING)
+ {
/*
* Don't enable serve-stale if the result signals a duplicate
- * query or query that is being dropped.
+ * query or a query that is being dropped or can't proceed
+ * because of a recursion loop.
*/
return (false);
}
@@ -11538,12 +11580,7 @@ ns_query_done(query_ctx_t *qctx) {
/*
* Client may have been detached after query_send(), so
* we test and store the flag state here, for safety.
- * If we are refreshing the RRSet, we must not detach from the client
- * in the query_send(), so we need to override the flag.
*/
- if (qctx->refresh_rrset) {
- qctx->client->nodetach = true;
- }
nodetach = qctx->client->nodetach;
query_send(qctx->client);
diff --git a/external/mpl/bind/dist/tsan-suppressions.txt b/external/mpl/bind/dist/tsan-suppressions.txt
deleted file mode 100644
index b12e03892f9..00000000000
--- a/external/mpl/bind/dist/tsan-suppressions.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-# Uninstrumented library.
-called_from_lib:libfstrm.so
diff --git a/external/mpl/bind/lib/libisc/Makefile b/external/mpl/bind/lib/libisc/Makefile
index cf5a27ce6f2..0294222e4cc 100644
--- a/external/mpl/bind/lib/libisc/Makefile
+++ b/external/mpl/bind/lib/libisc/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.19 2023/05/09 14:08:18 christos Exp $
+# $NetBSD: Makefile,v 1.20 2023/06/26 22:03:01 christos Exp $
LIB=isc
#USE_SHLIBDIR= yes
@@ -67,6 +67,7 @@ LDADD+=-Wl,-Bdynamic
LDADD+=-lz
DPADD+=${LIBZ}
+COPTS.iterated_hash.c+= -Wno-error=deprecated-declarations
COPTS.hmac.c+= -Wno-error=deprecated-declarations
COPTS.md.c+= -Wno-error=deprecated-declarations