mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-22 01:59:26 +00:00
make all ISC_LIST_FOREACH calls safe
previously, ISC_LIST_FOREACH and ISC_LIST_FOREACH_SAFE were two separate macros, with the _SAFE version allowing entries to be unlinked during the loop. ISC_LIST_FOREACH is now also safe, and the separate _SAFE macro has been removed. similarly, the ISC_LIST_FOREACH_REV macro is now safe, and ISC_LIST_FOREACH_REV_SAFE has also been removed.
This commit is contained in:
parent
94c4181442
commit
8487e43ad9
@ -956,7 +956,7 @@ addserver(dns_client_t *client) {
|
||||
CHECK(dns_client_setservers(client, dns_rdataclass_in, name, &servers));
|
||||
|
||||
cleanup:
|
||||
ISC_LIST_FOREACH_SAFE (servers, s, link) {
|
||||
ISC_LIST_FOREACH (servers, s, link) {
|
||||
ISC_LIST_UNLINK(servers, s, link);
|
||||
isc_mem_put(mctx, s, sizeof(*s));
|
||||
}
|
||||
@ -984,7 +984,7 @@ findserver(dns_client_t *client) {
|
||||
|
||||
/* Get nameservers from resolv.conf */
|
||||
nameservers = irs_resconf_getnameservers(resconf);
|
||||
ISC_LIST_FOREACH_SAFE (*nameservers, sa, link) {
|
||||
ISC_LIST_FOREACH (*nameservers, sa, link) {
|
||||
/* Set destination port */
|
||||
if (sa->type.sa.sa_family == AF_INET && use_ipv4) {
|
||||
sa->type.sin.sin_port = htons(destport);
|
||||
|
@ -502,7 +502,7 @@ get_server_list(irs_resconf_t *resconf) {
|
||||
void
|
||||
flush_server_list(void) {
|
||||
debug("flush_server_list()");
|
||||
ISC_LIST_FOREACH_SAFE (server_list, s, link) {
|
||||
ISC_LIST_FOREACH (server_list, s, link) {
|
||||
ISC_LIST_DEQUEUE(server_list, s, link);
|
||||
isc_mem_free(mctx, s);
|
||||
}
|
||||
@ -549,7 +549,7 @@ set_nameserver(char *opt) {
|
||||
void
|
||||
clone_server_list(dig_serverlist_t src, dig_serverlist_t *dest) {
|
||||
debug("clone_server_list()");
|
||||
ISC_LIST_FOREACH_SAFE (src, srv, link) {
|
||||
ISC_LIST_FOREACH (src, srv, link) {
|
||||
dig_server_t *newsrv = make_server(srv->servername,
|
||||
srv->userarg);
|
||||
ISC_LINK_INIT(newsrv, link);
|
||||
@ -1200,7 +1200,7 @@ make_searchlist_entry(char *domain) {
|
||||
|
||||
static void
|
||||
clear_searchlist(void) {
|
||||
ISC_LIST_FOREACH_SAFE (search_list, search, link) {
|
||||
ISC_LIST_FOREACH (search_list, search, link) {
|
||||
ISC_LIST_UNLINK(search_list, search, link);
|
||||
isc_mem_free(mctx, search);
|
||||
}
|
||||
@ -1538,7 +1538,7 @@ _destroy_lookup(dig_lookup_t *lookup) {
|
||||
|
||||
isc_refcount_destroy(&lookup->references);
|
||||
|
||||
ISC_LIST_FOREACH_SAFE (lookup->my_server_list, s, link) {
|
||||
ISC_LIST_FOREACH (lookup->my_server_list, s, link) {
|
||||
debug("freeing server %p belonging to %p", s, lookup);
|
||||
ISC_LIST_DEQUEUE(lookup->my_server_list, s, link);
|
||||
isc_mem_free(mctx, s);
|
||||
@ -2718,7 +2718,7 @@ send_done(isc_nmhandle_t *handle, isc_result_t eresult, void *arg) {
|
||||
static void
|
||||
_cancel_lookup(dig_lookup_t *lookup, const char *file, unsigned int line) {
|
||||
debug("%s:%u:%s()", file, line, __func__);
|
||||
ISC_LIST_FOREACH_SAFE (lookup->q, query, link) {
|
||||
ISC_LIST_FOREACH (lookup->q, query, link) {
|
||||
REQUIRE(DIG_VALID_QUERY(query));
|
||||
ISC_LIST_DEQUEUE(lookup->q, query, link);
|
||||
debug("canceling pending query %p, belonging to %p", query,
|
||||
@ -4644,7 +4644,7 @@ cancel_all(void) {
|
||||
cancel_now = true;
|
||||
|
||||
while (current_lookup != NULL) {
|
||||
ISC_LIST_FOREACH_SAFE (current_lookup->q, q, link) {
|
||||
ISC_LIST_FOREACH (current_lookup->q, q, link) {
|
||||
debug("canceling pending query %p, belonging to %p", q,
|
||||
current_lookup);
|
||||
q->canceled = true;
|
||||
@ -4663,7 +4663,7 @@ cancel_all(void) {
|
||||
lookup_detach(¤t_lookup);
|
||||
}
|
||||
}
|
||||
ISC_LIST_FOREACH_SAFE (lookup_list, l, link) {
|
||||
ISC_LIST_FOREACH (lookup_list, l, link) {
|
||||
ISC_LIST_DEQUEUE(lookup_list, l, link);
|
||||
lookup_detach(&l);
|
||||
}
|
||||
|
@ -217,7 +217,7 @@ freelist(dns_rdataset_t *rdataset) {
|
||||
|
||||
dns_rdatalist_fromrdataset(rdataset, &rdlist);
|
||||
|
||||
ISC_LIST_FOREACH_SAFE (rdlist->rdata, rdata, link) {
|
||||
ISC_LIST_FOREACH (rdlist->rdata, rdata, link) {
|
||||
ISC_LIST_UNLINK(rdlist->rdata, rdata, link);
|
||||
isc_mem_put(mctx, rdata, sizeof(*rdata));
|
||||
}
|
||||
|
@ -236,7 +236,7 @@ get_dnskeys(ksr_ctx_t *ksr, dns_dnsseckeylist_t *keys) {
|
||||
keys_sorted[i++] = dk;
|
||||
}
|
||||
qsort(keys_sorted, n, sizeof(dns_dnsseckey_t *), keyalgtag_cmp);
|
||||
ISC_LIST_FOREACH_SAFE (keys_read, key, link) {
|
||||
ISC_LIST_FOREACH (keys_read, key, link) {
|
||||
ISC_LIST_UNLINK(keys_read, key, link);
|
||||
}
|
||||
/* Save sorted list in 'keys' */
|
||||
@ -263,14 +263,14 @@ setcontext(ksr_ctx_t *ksr, dns_kasp_t *kasp) {
|
||||
|
||||
static void
|
||||
cleanup(dns_dnsseckeylist_t *keys, dns_kasp_t *kasp) {
|
||||
ISC_LIST_FOREACH_SAFE (*keys, key, link) {
|
||||
ISC_LIST_FOREACH (*keys, key, link) {
|
||||
ISC_LIST_UNLINK(*keys, key, link);
|
||||
dst_key_free(&key->key);
|
||||
dns_dnsseckey_destroy(mctx, &key);
|
||||
}
|
||||
dns_kasp_detach(&kasp);
|
||||
|
||||
ISC_LIST_FOREACH_SAFE (cleanup_list, cbuf, link) {
|
||||
ISC_LIST_FOREACH (cleanup_list, cbuf, link) {
|
||||
ISC_LIST_UNLINK(cleanup_list, cbuf, link);
|
||||
isc_buffer_free(&cbuf);
|
||||
}
|
||||
@ -309,7 +309,7 @@ freerrset(dns_rdataset_t *rdataset) {
|
||||
|
||||
dns_rdatalist_fromrdataset(rdataset, &rdlist);
|
||||
|
||||
ISC_LIST_FOREACH_SAFE (rdlist->rdata, rdata, link) {
|
||||
ISC_LIST_FOREACH (rdlist->rdata, rdata, link) {
|
||||
ISC_LIST_UNLINK(rdlist->rdata, rdata, link);
|
||||
isc_mem_put(mctx, rdata, sizeof(*rdata));
|
||||
}
|
||||
|
@ -2725,7 +2725,7 @@ report(const char *format, ...) {
|
||||
|
||||
static void
|
||||
clear_keylist(dns_dnsseckeylist_t *list) {
|
||||
ISC_LIST_FOREACH_SAFE (*list, key, link) {
|
||||
ISC_LIST_FOREACH (*list, key, link) {
|
||||
ISC_LIST_UNLINK(*list, key, link);
|
||||
dns_dnsseckey_destroy(mctx, &key);
|
||||
}
|
||||
@ -2883,7 +2883,7 @@ findkeys:
|
||||
clear_keylist(&rmkeys);
|
||||
clear_keylist(&matchkeys);
|
||||
|
||||
ISC_LIST_FOREACH_SAFE (digests, d, link) {
|
||||
ISC_LIST_FOREACH (digests, d, link) {
|
||||
ISC_LIST_UNLINK(digests, d, link);
|
||||
isc_mem_put(mctx, d, sizeof(*d));
|
||||
}
|
||||
@ -4059,7 +4059,7 @@ main(int argc, char *argv[]) {
|
||||
|
||||
hashlist_free(&hashlist);
|
||||
|
||||
ISC_LIST_FOREACH_SAFE (keylist, key, link) {
|
||||
ISC_LIST_FOREACH (keylist, key, link) {
|
||||
ISC_LIST_UNLINK(keylist, key, link);
|
||||
dns_dnsseckey_destroy(mctx, &key);
|
||||
}
|
||||
|
@ -652,7 +652,7 @@ kasp_from_conf(cfg_obj_t *config, isc_mem_t *mctx, const char *name,
|
||||
/*
|
||||
* Cleanup kasp list.
|
||||
*/
|
||||
ISC_LIST_FOREACH_SAFE (kasplist, kasp, link) {
|
||||
ISC_LIST_FOREACH (kasplist, kasp, link) {
|
||||
ISC_LIST_UNLINK(kasplist, kasp, link);
|
||||
dns_kasp_detach(&kasp);
|
||||
}
|
||||
@ -660,7 +660,7 @@ kasp_from_conf(cfg_obj_t *config, isc_mem_t *mctx, const char *name,
|
||||
/*
|
||||
* Cleanup keystore list.
|
||||
*/
|
||||
ISC_LIST_FOREACH_SAFE (kslist, ks, link) {
|
||||
ISC_LIST_FOREACH (kslist, ks, link) {
|
||||
ISC_LIST_UNLINK(kslist, ks, link);
|
||||
dns_keystore_detach(&ks);
|
||||
}
|
||||
|
@ -798,8 +798,8 @@ destroynode(bdbnode_t *node) {
|
||||
bdb = node->bdb;
|
||||
mctx = bdb->common.mctx;
|
||||
|
||||
ISC_LIST_FOREACH_SAFE (node->lists, list, link) {
|
||||
ISC_LIST_FOREACH_SAFE (list->rdata, rdata, link) {
|
||||
ISC_LIST_FOREACH (node->lists, list, link) {
|
||||
ISC_LIST_FOREACH (list->rdata, rdata, link) {
|
||||
ISC_LIST_UNLINK(list->rdata, rdata, link);
|
||||
isc_mem_put(mctx, rdata, sizeof(dns_rdata_t));
|
||||
}
|
||||
@ -807,7 +807,7 @@ destroynode(bdbnode_t *node) {
|
||||
isc_mem_put(mctx, list, sizeof(dns_rdatalist_t));
|
||||
}
|
||||
|
||||
ISC_LIST_FOREACH_SAFE (node->buffers, b, link) {
|
||||
ISC_LIST_FOREACH (node->buffers, b, link) {
|
||||
ISC_LIST_UNLINK(node->buffers, b, link);
|
||||
isc_buffer_free(&b);
|
||||
}
|
||||
|
@ -170,7 +170,7 @@ free_controlkey(controlkey_t *key, isc_mem_t *mctx) {
|
||||
|
||||
static void
|
||||
free_controlkeylist(controlkeylist_t *keylist, isc_mem_t *mctx) {
|
||||
ISC_LIST_FOREACH_SAFE (*keylist, key, link) {
|
||||
ISC_LIST_FOREACH (*keylist, key, link) {
|
||||
ISC_LIST_UNLINK(*keylist, key, link);
|
||||
free_controlkey(key, mctx);
|
||||
}
|
||||
@ -207,7 +207,7 @@ shutdown_listener(controllistener_t *listener) {
|
||||
}
|
||||
listener->shuttingdown = true;
|
||||
|
||||
ISC_LIST_FOREACH_SAFE (listener->connections, conn, link) {
|
||||
ISC_LIST_FOREACH (listener->connections, conn, link) {
|
||||
conn_shutdown(conn);
|
||||
}
|
||||
|
||||
@ -647,7 +647,7 @@ control_newconn(isc_nmhandle_t *handle, isc_result_t result, void *arg) {
|
||||
|
||||
static void
|
||||
controls_shutdown(named_controls_t *controls) {
|
||||
ISC_LIST_FOREACH_SAFE (controls->listeners, listener, link) {
|
||||
ISC_LIST_FOREACH (controls->listeners, listener, link) {
|
||||
/*
|
||||
* As listeners shut down, they will call their callbacks.
|
||||
*/
|
||||
@ -733,7 +733,7 @@ register_keys(const cfg_obj_t *control, const cfg_obj_t *keylist,
|
||||
/*
|
||||
* Find the keys corresponding to the keyids used by this listener.
|
||||
*/
|
||||
ISC_LIST_FOREACH_SAFE (*keyids, keyid, link) {
|
||||
ISC_LIST_FOREACH (*keyids, keyid, link) {
|
||||
result = cfgkeylist_find(keylist, keyid->keyname, &keydef);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
cfg_obj_log(control, ISC_LOG_WARNING,
|
||||
|
@ -6072,7 +6072,7 @@ configure_forward(const cfg_obj_t *config, dns_view_t *view,
|
||||
|
||||
cleanup:
|
||||
|
||||
ISC_LIST_FOREACH_SAFE (fwdlist, fwd, link) {
|
||||
ISC_LIST_FOREACH (fwdlist, fwd, link) {
|
||||
ISC_LIST_UNLINK(fwdlist, fwd, link);
|
||||
if (fwd->tlsname != NULL) {
|
||||
dns_name_free(fwd->tlsname, view->mctx);
|
||||
@ -9239,7 +9239,7 @@ load_configuration(const char *filename, named_server_t *server,
|
||||
* were swapped above or not.
|
||||
*/
|
||||
cleanup_altsecrets:
|
||||
ISC_LIST_FOREACH_SAFE (altsecrets, as, link) {
|
||||
ISC_LIST_FOREACH (altsecrets, as, link) {
|
||||
ISC_LIST_UNLINK(altsecrets, as, link);
|
||||
isc_mem_put(server->sctx->mctx, as, sizeof(*as));
|
||||
}
|
||||
@ -9250,7 +9250,7 @@ cleanup_logc:
|
||||
}
|
||||
|
||||
cleanup_cachelist:
|
||||
ISC_LIST_FOREACH_SAFE (cachelist, nsc, link) {
|
||||
ISC_LIST_FOREACH (cachelist, nsc, link) {
|
||||
ISC_LIST_UNLINK(cachelist, nsc, link);
|
||||
dns_cache_detach(&nsc->cache);
|
||||
isc_mem_put(server->mctx, nsc, sizeof(*nsc));
|
||||
@ -9259,7 +9259,7 @@ cleanup_cachelist:
|
||||
ISC_LIST_APPENDLIST(viewlist, builtin_viewlist, link);
|
||||
|
||||
cleanup_viewlist:
|
||||
ISC_LIST_FOREACH_SAFE (viewlist, view, link) {
|
||||
ISC_LIST_FOREACH (viewlist, view, link) {
|
||||
ISC_LIST_UNLINK(viewlist, view, link);
|
||||
if (result == ISC_R_SUCCESS && strcmp(view->name, "_bind") != 0)
|
||||
{
|
||||
@ -9270,13 +9270,13 @@ cleanup_viewlist:
|
||||
}
|
||||
|
||||
cleanup_kasplist:
|
||||
ISC_LIST_FOREACH_SAFE (kasplist, kasp, link) {
|
||||
ISC_LIST_FOREACH (kasplist, kasp, link) {
|
||||
ISC_LIST_UNLINK(kasplist, kasp, link);
|
||||
dns_kasp_detach(&kasp);
|
||||
}
|
||||
|
||||
cleanup_keystorelist:
|
||||
ISC_LIST_FOREACH_SAFE (keystorelist, keystore, link) {
|
||||
ISC_LIST_FOREACH (keystorelist, keystore, link) {
|
||||
ISC_LIST_UNLINK(keystorelist, keystore, link);
|
||||
dns_keystore_detach(&keystore);
|
||||
}
|
||||
@ -9548,17 +9548,17 @@ shutdown_server(void *arg) {
|
||||
|
||||
(void)named_server_saventa(server);
|
||||
|
||||
ISC_LIST_FOREACH_SAFE (server->kasplist, kasp, link) {
|
||||
ISC_LIST_FOREACH (server->kasplist, kasp, link) {
|
||||
ISC_LIST_UNLINK(server->kasplist, kasp, link);
|
||||
dns_kasp_detach(&kasp);
|
||||
}
|
||||
|
||||
ISC_LIST_FOREACH_SAFE (server->keystorelist, keystore, link) {
|
||||
ISC_LIST_FOREACH (server->keystorelist, keystore, link) {
|
||||
ISC_LIST_UNLINK(server->keystorelist, keystore, link);
|
||||
dns_keystore_detach(&keystore);
|
||||
}
|
||||
|
||||
ISC_LIST_FOREACH_SAFE (server->viewlist, view, link) {
|
||||
ISC_LIST_FOREACH (server->viewlist, view, link) {
|
||||
view_next = ISC_LIST_NEXT(view, link);
|
||||
ISC_LIST_UNLINK(server->viewlist, view, link);
|
||||
dns_view_flushonshutdown(view, flush);
|
||||
@ -9570,7 +9570,7 @@ shutdown_server(void *arg) {
|
||||
*/
|
||||
dns_dyndb_cleanup();
|
||||
|
||||
ISC_LIST_FOREACH_SAFE (server->cachelist, nsc, link) {
|
||||
ISC_LIST_FOREACH (server->cachelist, nsc, link) {
|
||||
ISC_LIST_UNLINK(server->cachelist, nsc, link);
|
||||
dns_cache_detach(&nsc->cache);
|
||||
isc_mem_put(server->mctx, nsc, sizeof(*nsc));
|
||||
@ -11103,9 +11103,9 @@ add_view_tolist(struct dumpcontext *dctx, dns_view_t *view) {
|
||||
|
||||
static void
|
||||
dumpcontext_destroy(struct dumpcontext *dctx) {
|
||||
ISC_LIST_FOREACH_SAFE (dctx->viewlist, vle, link) {
|
||||
ISC_LIST_FOREACH (dctx->viewlist, vle, link) {
|
||||
ISC_LIST_UNLINK(dctx->viewlist, vle, link);
|
||||
ISC_LIST_FOREACH_SAFE (vle->zonelist, zle, link) {
|
||||
ISC_LIST_FOREACH (vle->zonelist, zle, link) {
|
||||
ISC_LIST_UNLINK(vle->zonelist, zle, link);
|
||||
dns_zone_detach(&zle->zone);
|
||||
isc_mem_put(dctx->mctx, zle, sizeof *zle);
|
||||
@ -14700,7 +14700,7 @@ cleanup:
|
||||
dns_db_detach(&db);
|
||||
}
|
||||
|
||||
ISC_LIST_FOREACH_SAFE (keys, key, link) {
|
||||
ISC_LIST_FOREACH (keys, key, link) {
|
||||
ISC_LIST_UNLINK(keys, key, link);
|
||||
dns_dnsseckey_destroy(dns_zone_getmctx(zone), &key);
|
||||
}
|
||||
|
@ -3927,7 +3927,7 @@ named_statschannels_configure(named_server_t *server, const cfg_obj_t *config,
|
||||
}
|
||||
}
|
||||
|
||||
ISC_LIST_FOREACH_SAFE (server->statschannels, listener, link) {
|
||||
ISC_LIST_FOREACH (server->statschannels, listener, link) {
|
||||
ISC_LIST_UNLINK(server->statschannels, listener, link);
|
||||
shutdown_listener(listener);
|
||||
}
|
||||
@ -3938,7 +3938,7 @@ named_statschannels_configure(named_server_t *server, const cfg_obj_t *config,
|
||||
|
||||
void
|
||||
named_statschannels_shutdown(named_server_t *server) {
|
||||
ISC_LIST_FOREACH_SAFE (server->statschannels, listener, link) {
|
||||
ISC_LIST_FOREACH (server->statschannels, listener, link) {
|
||||
ISC_LIST_UNLINK(server->statschannels, listener, link);
|
||||
shutdown_listener(listener);
|
||||
}
|
||||
|
@ -677,7 +677,7 @@ cleanup:
|
||||
dns_db_detach(&db);
|
||||
}
|
||||
for (i = 0; rdatalists[i] != NULL; i++) {
|
||||
ISC_LIST_FOREACH_SAFE (rdatalists[i]->rdata, rdata, link) {
|
||||
ISC_LIST_FOREACH (rdatalists[i]->rdata, rdata, link) {
|
||||
ISC_LIST_UNLINK(rdatalists[i]->rdata, rdata, link);
|
||||
dns_rdata_toregion(rdata, ®ion);
|
||||
isc_mem_put(mctx, rdata,
|
||||
|
@ -2185,7 +2185,7 @@ setzone(dns_name_t *zonename) {
|
||||
name = ISC_LIST_HEAD(secs[DNS_SECTION_ZONE]);
|
||||
ISC_LIST_UNLINK(secs[DNS_SECTION_ZONE], name, link);
|
||||
|
||||
ISC_LIST_FOREACH_SAFE (name->list, rdataset, link) {
|
||||
ISC_LIST_FOREACH (name->list, rdataset, link) {
|
||||
ISC_LIST_UNLINK(name->list, rdataset, link);
|
||||
dns_rdataset_disassociate(rdataset);
|
||||
dns_message_puttemprdataset(updatemsg, &rdataset);
|
||||
|
@ -2161,7 +2161,7 @@ main(int argc, char *argv[]) {
|
||||
|
||||
isc_loopmgr_run(loopmgr);
|
||||
|
||||
ISC_LIST_FOREACH_SAFE (queries, query, link) {
|
||||
ISC_LIST_FOREACH (queries, query, link) {
|
||||
if (query->ednsopts != NULL) {
|
||||
for (i = 0; i < EDNSOPTS; i++) {
|
||||
if (query->ednsopts[i].value != NULL) {
|
||||
|
@ -456,7 +456,7 @@ dns_aclelement_match(const isc_netaddr_t *reqaddr, const dns_name_t *reqsigner,
|
||||
|
||||
static void
|
||||
dns__acl_destroy_port_transports(dns_acl_t *acl) {
|
||||
ISC_LIST_FOREACH_SAFE (acl->ports_and_transports, port_proto, link) {
|
||||
ISC_LIST_FOREACH (acl->ports_and_transports, port_proto, link) {
|
||||
ISC_LIST_DEQUEUE(acl->ports_and_transports, port_proto, link);
|
||||
isc_mem_put(acl->mctx, port_proto, sizeof(*port_proto));
|
||||
}
|
||||
|
@ -732,7 +732,7 @@ maybe_expire_namehooks(dns_adbname_t *adbname, isc_stdtime_t now) {
|
||||
static void
|
||||
shutdown_names(dns_adb_t *adb) {
|
||||
RWLOCK(&adb->names_lock, isc_rwlocktype_write);
|
||||
ISC_LIST_FOREACH_SAFE (adb->names_lru, name, link) {
|
||||
ISC_LIST_FOREACH (adb->names_lru, name, link) {
|
||||
dns_adbname_ref(name);
|
||||
LOCK(&name->lock);
|
||||
/*
|
||||
@ -751,7 +751,7 @@ shutdown_names(dns_adb_t *adb) {
|
||||
static void
|
||||
shutdown_entries(dns_adb_t *adb) {
|
||||
RWLOCK(&adb->entries_lock, isc_rwlocktype_write);
|
||||
ISC_LIST_FOREACH_SAFE (adb->entries_lru, adbentry, link) {
|
||||
ISC_LIST_FOREACH (adb->entries_lru, adbentry, link) {
|
||||
expire_entry(adbentry);
|
||||
}
|
||||
RWUNLOCK(&adb->entries_lock, isc_rwlocktype_write);
|
||||
@ -762,7 +762,7 @@ shutdown_entries(dns_adb_t *adb) {
|
||||
*/
|
||||
static void
|
||||
clean_namehooks(dns_adb_t *adb, dns_adbnamehooklist_t *namehooks) {
|
||||
ISC_LIST_FOREACH_SAFE (*namehooks, namehook, name_link) {
|
||||
ISC_LIST_FOREACH (*namehooks, namehook, name_link) {
|
||||
INSIST(DNS_ADBNAMEHOOK_VALID(namehook));
|
||||
INSIST(DNS_ADBENTRY_VALID(namehook->entry));
|
||||
|
||||
@ -1568,7 +1568,7 @@ purge_stale_names(dns_adb_t *adb, isc_stdtime_t now) {
|
||||
static void
|
||||
cleanup_names(dns_adb_t *adb, isc_stdtime_t now) {
|
||||
RWLOCK(&adb->names_lock, isc_rwlocktype_write);
|
||||
ISC_LIST_FOREACH_SAFE (adb->names_lru, adbname, link) {
|
||||
ISC_LIST_FOREACH (adb->names_lru, adbname, link) {
|
||||
dns_adbname_ref(adbname);
|
||||
LOCK(&adbname->lock);
|
||||
/*
|
||||
@ -1665,7 +1665,7 @@ purge_stale_entries(dns_adb_t *adb, isc_stdtime_t now) {
|
||||
static void
|
||||
cleanup_entries(dns_adb_t *adb, isc_stdtime_t now) {
|
||||
RWLOCK(&adb->entries_lock, isc_rwlocktype_write);
|
||||
ISC_LIST_FOREACH_SAFE (adb->entries_lru, adbentry, link) {
|
||||
ISC_LIST_FOREACH (adb->entries_lru, adbentry, link) {
|
||||
dns_adbentry_ref(adbentry);
|
||||
LOCK(&adbentry->lock);
|
||||
maybe_expire_entry(adbentry, now);
|
||||
@ -2142,7 +2142,7 @@ dns_adb_destroyfind(dns_adbfind_t **findp) {
|
||||
* we also need to decrement the reference counter in the
|
||||
* associated adbentry every time we remove one from the list.
|
||||
*/
|
||||
ISC_LIST_FOREACH_SAFE (find->list, ai, publink) {
|
||||
ISC_LIST_FOREACH (find->list, ai, publink) {
|
||||
ISC_LIST_UNLINK(find->list, ai, publink);
|
||||
free_adbaddrinfo(adb, &ai);
|
||||
}
|
||||
@ -3318,7 +3318,7 @@ dns_adb_flushnames(dns_adb_t *adb, const dns_name_t *name) {
|
||||
}
|
||||
|
||||
RWLOCK(&adb->names_lock, isc_rwlocktype_write);
|
||||
ISC_LIST_FOREACH_SAFE (adb->names_lru, adbname, link) {
|
||||
ISC_LIST_FOREACH (adb->names_lru, adbname, link) {
|
||||
dns_adbname_ref(adbname);
|
||||
LOCK(&adbname->lock);
|
||||
if (dns_name_issubdomain(adbname->name, name)) {
|
||||
|
@ -771,7 +771,7 @@ client_resfind(resctx_t *rctx, dns_fetchresponse_t *resp) {
|
||||
* Free temporary resources
|
||||
*/
|
||||
if (ansname != NULL) {
|
||||
ISC_LIST_FOREACH_SAFE (ansname->list, rdataset, link) {
|
||||
ISC_LIST_FOREACH (ansname->list, rdataset, link) {
|
||||
ISC_LIST_UNLINK(ansname->list, rdataset, link);
|
||||
putrdataset(mctx, &rdataset);
|
||||
}
|
||||
@ -820,7 +820,7 @@ client_resfind(resctx_t *rctx, dns_fetchresponse_t *resp) {
|
||||
} while (want_restart);
|
||||
|
||||
if (send_event) {
|
||||
ISC_LIST_FOREACH_SAFE (rctx->namelist, n, link) {
|
||||
ISC_LIST_FOREACH (rctx->namelist, n, link) {
|
||||
ISC_LIST_UNLINK(rctx->namelist, n, link);
|
||||
ISC_LIST_APPEND(rctx->rev->answerlist, n, link);
|
||||
}
|
||||
@ -840,7 +840,7 @@ resolve_done(void *arg) {
|
||||
resarg->result = rev->result;
|
||||
resarg->vresult = rev->vresult;
|
||||
|
||||
ISC_LIST_FOREACH_SAFE (rev->answerlist, name, link) {
|
||||
ISC_LIST_FOREACH (rev->answerlist, name, link) {
|
||||
ISC_LIST_UNLINK(rev->answerlist, name, link);
|
||||
ISC_LIST_APPEND(*resarg->namelist, name, link);
|
||||
}
|
||||
@ -999,10 +999,10 @@ dns_client_freeresanswer(dns_client_t *client, dns_namelist_t *namelist) {
|
||||
REQUIRE(DNS_CLIENT_VALID(client));
|
||||
REQUIRE(namelist != NULL);
|
||||
|
||||
ISC_LIST_FOREACH_SAFE (*namelist, name, link) {
|
||||
ISC_LIST_FOREACH (*namelist, name, link) {
|
||||
ISC_LIST_UNLINK(*namelist, name, link);
|
||||
|
||||
ISC_LIST_FOREACH_SAFE (name->list, rdataset, link) {
|
||||
ISC_LIST_FOREACH (name->list, rdataset, link) {
|
||||
ISC_LIST_UNLINK(name->list, rdataset, link);
|
||||
putrdataset(client->mctx, &rdataset);
|
||||
}
|
||||
|
@ -130,7 +130,7 @@ dns_diff_init(isc_mem_t *mctx, dns_diff_t *diff) {
|
||||
void
|
||||
dns_diff_clear(dns_diff_t *diff) {
|
||||
REQUIRE(DNS_DIFF_VALID(diff));
|
||||
ISC_LIST_FOREACH_SAFE (diff->tuples, t, link) {
|
||||
ISC_LIST_FOREACH (diff->tuples, t, link) {
|
||||
ISC_LIST_UNLINK(diff->tuples, t, link);
|
||||
dns_difftuple_free(&t);
|
||||
}
|
||||
@ -184,7 +184,7 @@ dns_diff_appendminimal(dns_diff_t *diff, dns_difftuple_t **tuplep) {
|
||||
* the one we are doing, there must be a programming
|
||||
* error. We report it but try to continue anyway.
|
||||
*/
|
||||
ISC_LIST_FOREACH_SAFE (diff->tuples, ot, link) {
|
||||
ISC_LIST_FOREACH (diff->tuples, ot, link) {
|
||||
if (dns_name_caseequal(&ot->name, &(*tuplep)->name) &&
|
||||
dns_rdata_compare(&ot->rdata, &(*tuplep)->rdata) == 0 &&
|
||||
ot->ttl == (*tuplep)->ttl)
|
||||
|
@ -734,7 +734,7 @@ tcp_recv_shutdown(dns_dispatch_t *disp, dns_displist_t *resps,
|
||||
/*
|
||||
* If there are any active responses, shut them all down.
|
||||
*/
|
||||
ISC_LIST_FOREACH_SAFE (disp->active, resp, alink) {
|
||||
ISC_LIST_FOREACH (disp->active, resp, alink) {
|
||||
tcp_recv_add(resps, resp, result);
|
||||
}
|
||||
disp->state = DNS_DISPATCHSTATE_CANCELED;
|
||||
@ -742,7 +742,7 @@ tcp_recv_shutdown(dns_dispatch_t *disp, dns_displist_t *resps,
|
||||
|
||||
static void
|
||||
tcp_recv_processall(dns_displist_t *resps, isc_region_t *region) {
|
||||
ISC_LIST_FOREACH_SAFE (*resps, resp, rlink) {
|
||||
ISC_LIST_FOREACH (*resps, resp, rlink) {
|
||||
ISC_LIST_UNLINK(*resps, resp, rlink);
|
||||
|
||||
dispentry_log(resp, ISC_LOG_DEBUG(90), "read callback: %s",
|
||||
@ -1845,7 +1845,7 @@ tcp_connected(isc_nmhandle_t *handle, isc_result_t eresult, void *arg) {
|
||||
* If there are pending responses, call the connect
|
||||
* callbacks for all of them.
|
||||
*/
|
||||
ISC_LIST_FOREACH_SAFE (disp->pending, resp, plink) {
|
||||
ISC_LIST_FOREACH (disp->pending, resp, plink) {
|
||||
ISC_LIST_UNLINK(disp->pending, resp, plink);
|
||||
ISC_LIST_APPEND(resps, resp, rlink);
|
||||
resp->result = eresult;
|
||||
@ -1879,7 +1879,7 @@ tcp_connected(isc_nmhandle_t *handle, isc_result_t eresult, void *arg) {
|
||||
disp->state = DNS_DISPATCHSTATE_NONE;
|
||||
}
|
||||
|
||||
ISC_LIST_FOREACH_SAFE (resps, resp, rlink) {
|
||||
ISC_LIST_FOREACH (resps, resp, rlink) {
|
||||
ISC_LIST_UNLINK(resps, resp, rlink);
|
||||
|
||||
resp_connected(resp);
|
||||
|
@ -532,7 +532,7 @@ dns_dns64_apply(isc_mem_t *mctx, dns_dns64list_t dns64s, unsigned int count,
|
||||
|
||||
/* No applicable dns64; free the resources */
|
||||
isc_buffer_free(&buffer);
|
||||
ISC_LIST_FOREACH_SAFE (aaaalist->rdata, rdata, link) {
|
||||
ISC_LIST_FOREACH (aaaalist->rdata, rdata, link) {
|
||||
ISC_LIST_UNLINK(aaaalist->rdata, rdata, link);
|
||||
dns_message_puttemprdata(message, &rdata);
|
||||
}
|
||||
|
@ -1393,7 +1393,7 @@ dns_dnssec_findmatchingkeys(const dns_name_t *origin, dns_kasp_t *kasp,
|
||||
}
|
||||
|
||||
failure:
|
||||
ISC_LIST_FOREACH_SAFE (list, key, link) {
|
||||
ISC_LIST_FOREACH (list, key, link) {
|
||||
ISC_LIST_UNLINK(list, key, link);
|
||||
INSIST(key->key != NULL);
|
||||
dst_key_free(&key->key);
|
||||
@ -2180,7 +2180,7 @@ dns_dnssec_updatekeys(dns_dnsseckeylist_t *keys, dns_dnsseckeylist_t *newkeys,
|
||||
* Second, scan the list of newly found keys looking for matches
|
||||
* with known keys, and update accordingly.
|
||||
*/
|
||||
ISC_LIST_FOREACH_SAFE (*newkeys, key1, link) {
|
||||
ISC_LIST_FOREACH (*newkeys, key1, link) {
|
||||
bool key_revoked = false;
|
||||
char keystr1[DST_KEY_FORMATSIZE];
|
||||
char keystr2[DST_KEY_FORMATSIZE];
|
||||
@ -2337,7 +2337,7 @@ dns_dnssec_updatekeys(dns_dnsseckeylist_t *keys, dns_dnsseckeylist_t *newkeys,
|
||||
}
|
||||
|
||||
/* Free any leftover keys in newkeys */
|
||||
ISC_LIST_FOREACH_SAFE (*newkeys, key1, link) {
|
||||
ISC_LIST_FOREACH (*newkeys, key1, link) {
|
||||
ISC_LIST_UNLINK(*newkeys, key1, link);
|
||||
dns_dnsseckey_destroy(mctx, &key1);
|
||||
}
|
||||
|
@ -195,7 +195,7 @@ dns_fwdtable_destroy(dns_fwdtable_t **fwdtablep) {
|
||||
|
||||
static void
|
||||
destroy_forwarders(dns_forwarders_t *forwarders) {
|
||||
ISC_LIST_FOREACH_SAFE (forwarders->fwdrs, fwd, link) {
|
||||
ISC_LIST_FOREACH (forwarders->fwdrs, fwd, link) {
|
||||
ISC_LIST_UNLINK(forwarders->fwdrs, fwd, link);
|
||||
if (fwd->tlsname != NULL) {
|
||||
dns_name_free(fwd->tlsname, forwarders->mctx);
|
||||
|
@ -69,13 +69,13 @@ static void
|
||||
destroy(dns_kasp_t *kasp) {
|
||||
REQUIRE(!ISC_LINK_LINKED(kasp, link));
|
||||
|
||||
ISC_LIST_FOREACH_SAFE (kasp->keys, key, link) {
|
||||
ISC_LIST_FOREACH (kasp->keys, key, link) {
|
||||
ISC_LIST_UNLINK(kasp->keys, key, link);
|
||||
dns_kasp_key_destroy(key);
|
||||
}
|
||||
INSIST(ISC_LIST_EMPTY(kasp->keys));
|
||||
|
||||
ISC_LIST_FOREACH_SAFE (kasp->digests, digest, link) {
|
||||
ISC_LIST_FOREACH (kasp->digests, digest, link) {
|
||||
ISC_LIST_UNLINK(kasp->digests, digest, link);
|
||||
isc_mem_put(kasp->mctx, digest, sizeof(*digest));
|
||||
}
|
||||
|
@ -2268,7 +2268,7 @@ dns_keymgr_run(const dns_name_t *origin, dns_rdataclass_t rdclass,
|
||||
|
||||
failure:
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
ISC_LIST_FOREACH_SAFE (newkeys, newkey, link) {
|
||||
ISC_LIST_FOREACH (newkeys, newkey, link) {
|
||||
ISC_LIST_UNLINK(newkeys, newkey, link);
|
||||
INSIST(newkey->key != NULL);
|
||||
dst_key_free(&newkey->key);
|
||||
|
@ -103,7 +103,7 @@ static void
|
||||
destroy_keynode(dns_keynode_t *knode) {
|
||||
isc_rwlock_destroy(&knode->rwlock);
|
||||
if (knode->dslist != NULL) {
|
||||
ISC_LIST_FOREACH_SAFE (knode->dslist->rdata, rdata, link) {
|
||||
ISC_LIST_FOREACH (knode->dslist->rdata, rdata, link) {
|
||||
ISC_LIST_UNLINK(knode->dslist->rdata, rdata, link);
|
||||
isc_mem_put(knode->mctx, rdata->data,
|
||||
DNS_DS_BUFFERSIZE);
|
||||
|
@ -2116,10 +2116,10 @@ cleanup:
|
||||
callbacks->commit(callbacks->add_private);
|
||||
}
|
||||
|
||||
ISC_LIST_FOREACH_SAFE (current_list, this, link) {
|
||||
ISC_LIST_FOREACH (current_list, this, link) {
|
||||
ISC_LIST_UNLINK(current_list, this, link);
|
||||
}
|
||||
ISC_LIST_FOREACH_SAFE (glue_list, this, link) {
|
||||
ISC_LIST_FOREACH (glue_list, this, link) {
|
||||
ISC_LIST_UNLINK(glue_list, this, link);
|
||||
}
|
||||
if (rdatalist != NULL) {
|
||||
@ -2757,11 +2757,11 @@ grow_rdatalist(int new_len, dns_rdatalist_t *oldlist, int old_len,
|
||||
newlist = isc_mem_cget(mctx, new_len, sizeof(newlist[0]));
|
||||
|
||||
ISC_LIST_INIT(save);
|
||||
ISC_LIST_FOREACH_SAFE (*current, this, link) {
|
||||
ISC_LIST_FOREACH (*current, this, link) {
|
||||
ISC_LIST_UNLINK(*current, this, link);
|
||||
ISC_LIST_APPEND(save, this, link);
|
||||
}
|
||||
ISC_LIST_FOREACH_SAFE (save, this, link) {
|
||||
ISC_LIST_FOREACH (save, this, link) {
|
||||
ISC_LIST_UNLINK(save, this, link);
|
||||
INSIST(rdlcount < new_len);
|
||||
newlist[rdlcount] = *this;
|
||||
@ -2770,11 +2770,11 @@ grow_rdatalist(int new_len, dns_rdatalist_t *oldlist, int old_len,
|
||||
}
|
||||
|
||||
ISC_LIST_INIT(save);
|
||||
ISC_LIST_FOREACH_SAFE (*glue, this, link) {
|
||||
ISC_LIST_FOREACH (*glue, this, link) {
|
||||
ISC_LIST_UNLINK(*glue, this, link);
|
||||
ISC_LIST_APPEND(save, this, link);
|
||||
}
|
||||
ISC_LIST_FOREACH_SAFE (save, this, link) {
|
||||
ISC_LIST_FOREACH (save, this, link) {
|
||||
ISC_LIST_UNLINK(save, this, link);
|
||||
INSIST(rdlcount < new_len);
|
||||
newlist[rdlcount] = *this;
|
||||
@ -2807,11 +2807,11 @@ grow_rdata(int new_len, dns_rdata_t *oldlist, int old_len,
|
||||
*/
|
||||
ISC_LIST_FOREACH (*current, this, link) {
|
||||
ISC_LIST_INIT(save);
|
||||
ISC_LIST_FOREACH_SAFE (this->rdata, rdata, link) {
|
||||
ISC_LIST_FOREACH (this->rdata, rdata, link) {
|
||||
ISC_LIST_UNLINK(this->rdata, rdata, link);
|
||||
ISC_LIST_APPEND(save, rdata, link);
|
||||
}
|
||||
ISC_LIST_FOREACH_SAFE (save, rdata, link) {
|
||||
ISC_LIST_FOREACH (save, rdata, link) {
|
||||
ISC_LIST_UNLINK(save, rdata, link);
|
||||
INSIST(rdcount < new_len);
|
||||
newlist[rdcount] = *rdata;
|
||||
@ -2888,7 +2888,7 @@ commit(dns_rdatacallbacks_t *callbacks, dns_loadctx_t *lctx,
|
||||
|
||||
error = callbacks->error;
|
||||
|
||||
ISC_LIST_FOREACH_SAFE (*head, this, link) {
|
||||
ISC_LIST_FOREACH (*head, this, link) {
|
||||
dns_rdataset_init(&dataset);
|
||||
dns_rdatalist_tordataset(this, &dataset);
|
||||
dataset.trust = dns_trust_ultimate;
|
||||
|
@ -449,7 +449,7 @@ msginit(dns_message_t *m) {
|
||||
|
||||
static void
|
||||
msgresetname(dns_message_t *msg, dns_name_t *name) {
|
||||
ISC_LIST_FOREACH_SAFE (name->list, rds, link) {
|
||||
ISC_LIST_FOREACH (name->list, rds, link) {
|
||||
ISC_LIST_UNLINK(name->list, rds, link);
|
||||
dns__message_putassociatedrdataset(msg, &rds);
|
||||
}
|
||||
@ -459,7 +459,7 @@ static void
|
||||
msgresetnames(dns_message_t *msg, unsigned int first_section) {
|
||||
/* Clean up name lists. */
|
||||
for (size_t i = first_section; i < DNS_SECTION_MAX; i++) {
|
||||
ISC_LIST_FOREACH_SAFE (msg->sections[i], name, link) {
|
||||
ISC_LIST_FOREACH (msg->sections[i], name, link) {
|
||||
ISC_LIST_UNLINK(msg->sections[i], name, link);
|
||||
msgresetname(msg, name);
|
||||
dns_message_puttempname(msg, &name);
|
||||
@ -537,10 +537,10 @@ msgreset(dns_message_t *msg, bool everything) {
|
||||
* The memory isn't lost since these are part of message blocks we
|
||||
* have allocated.
|
||||
*/
|
||||
ISC_LIST_FOREACH_SAFE (msg->freerdata, rdata, link) {
|
||||
ISC_LIST_FOREACH (msg->freerdata, rdata, link) {
|
||||
ISC_LIST_UNLINK(msg->freerdata, rdata, link);
|
||||
}
|
||||
ISC_LIST_FOREACH_SAFE (msg->freerdatalist, rdatalist, link) {
|
||||
ISC_LIST_FOREACH (msg->freerdatalist, rdatalist, link) {
|
||||
ISC_LIST_UNLINK(msg->freerdatalist, rdatalist, link);
|
||||
}
|
||||
|
||||
@ -1975,8 +1975,8 @@ dns_message_rendersection(dns_message_t *msg, dns_section_t sectionid,
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
ISC_LIST_FOREACH_SAFE (*section, n, link) {
|
||||
ISC_LIST_FOREACH_SAFE (n->list, rds, link) {
|
||||
ISC_LIST_FOREACH (*section, n, link) {
|
||||
ISC_LIST_FOREACH (n->list, rds, link) {
|
||||
if ((rds->attributes &
|
||||
DNS_RDATASETATTR_RENDERED) != 0)
|
||||
{
|
||||
|
@ -135,7 +135,7 @@ dns_order_detach(dns_order_t **orderp) {
|
||||
if (isc_refcount_decrement(&order->references) == 1) {
|
||||
isc_refcount_destroy(&order->references);
|
||||
order->magic = 0;
|
||||
ISC_LIST_FOREACH_SAFE (order->ents, ent, link) {
|
||||
ISC_LIST_FOREACH (order->ents, ent, link) {
|
||||
ISC_LIST_UNLINK(order->ents, ent, link);
|
||||
isc_mem_put(order->mctx, ent, sizeof(*ent));
|
||||
}
|
||||
|
@ -167,7 +167,7 @@ peerlist_delete(dns_peerlist_t **list) {
|
||||
|
||||
isc_refcount_destroy(&l->refs);
|
||||
|
||||
ISC_LIST_FOREACH_SAFE (l->elements, server, next) {
|
||||
ISC_LIST_FOREACH (l->elements, server, next) {
|
||||
ISC_LIST_UNLINK(l->elements, server, next);
|
||||
dns_peer_detach(&server);
|
||||
}
|
||||
|
@ -1122,7 +1122,7 @@ cleanup_nondirty(qpz_version_t *version, qpz_changedlist_t *cleanup_list) {
|
||||
*
|
||||
* The caller must be holding the database lock.
|
||||
*/
|
||||
ISC_LIST_FOREACH_SAFE (version->changed_list, changed, link) {
|
||||
ISC_LIST_FOREACH (version->changed_list, changed, link) {
|
||||
if (!changed->dirty) {
|
||||
ISC_LIST_UNLINK(version->changed_list, changed, link);
|
||||
ISC_LIST_APPEND(*cleanup_list, changed, link);
|
||||
@ -1492,7 +1492,7 @@ closeversion(dns_db_t *db, dns_dbversion_t **versionp,
|
||||
/*
|
||||
* Commit/rollback re-signed headers.
|
||||
*/
|
||||
ISC_LIST_FOREACH_SAFE (resigned_list, header, link) {
|
||||
ISC_LIST_FOREACH (resigned_list, header, link) {
|
||||
isc_rwlock_t *nlock = NULL;
|
||||
isc_rwlocktype_t nlocktype = isc_rwlocktype_none;
|
||||
|
||||
@ -1513,7 +1513,7 @@ closeversion(dns_db_t *db, dns_dbversion_t **versionp,
|
||||
return;
|
||||
}
|
||||
|
||||
ISC_LIST_FOREACH_SAFE (cleanup_list, changed, link) {
|
||||
ISC_LIST_FOREACH (cleanup_list, changed, link) {
|
||||
isc_rwlock_t *nlock = NULL;
|
||||
isc_rwlocktype_t nlocktype = isc_rwlocktype_none;
|
||||
|
||||
|
@ -174,7 +174,7 @@ requests_shutdown(void *arg) {
|
||||
dns_requestmgr_t *requestmgr = arg;
|
||||
uint32_t tid = isc_tid();
|
||||
|
||||
ISC_LIST_FOREACH_SAFE (requestmgr->requests[tid], request, link) {
|
||||
ISC_LIST_FOREACH (requestmgr->requests[tid], request, link) {
|
||||
req_log(ISC_LOG_DEBUG(3), "%s(%" PRIu32 ": request %p",
|
||||
__func__, tid, request);
|
||||
if (DNS_REQUEST_COMPLETE(request)) {
|
||||
|
@ -348,7 +348,7 @@ resconf_parsedomain(irs_resconf_t *conf, FILE *fp) {
|
||||
|
||||
static void
|
||||
free_search(irs_resconf_t *conf) {
|
||||
ISC_LIST_FOREACH_SAFE (conf->searchlist, searchentry, link) {
|
||||
ISC_LIST_FOREACH (conf->searchlist, searchentry, link) {
|
||||
ISC_LIST_UNLINK(conf->searchlist, searchentry, link);
|
||||
isc_mem_free(conf->mctx, searchentry->domain);
|
||||
isc_mem_put(conf->mctx, searchentry, sizeof(*searchentry));
|
||||
@ -643,7 +643,7 @@ irs_resconf_destroy(irs_resconf_t **confp) {
|
||||
|
||||
free_search(conf);
|
||||
|
||||
ISC_LIST_FOREACH_SAFE (conf->nameservers, address, link) {
|
||||
ISC_LIST_FOREACH (conf->nameservers, address, link) {
|
||||
ISC_LIST_UNLINK(conf->nameservers, address, link);
|
||||
isc_mem_put(conf->mctx, address, sizeof(*address));
|
||||
}
|
||||
|
@ -1265,26 +1265,26 @@ static void
|
||||
fctx_cleanup(fetchctx_t *fctx) {
|
||||
REQUIRE(ISC_LIST_EMPTY(fctx->queries));
|
||||
|
||||
ISC_LIST_FOREACH_SAFE (fctx->finds, find, publink) {
|
||||
ISC_LIST_FOREACH (fctx->finds, find, publink) {
|
||||
ISC_LIST_UNLINK(fctx->finds, find, publink);
|
||||
dns_adb_destroyfind(&find);
|
||||
fetchctx_unref(fctx);
|
||||
}
|
||||
fctx->find = NULL;
|
||||
|
||||
ISC_LIST_FOREACH_SAFE (fctx->altfinds, find, publink) {
|
||||
ISC_LIST_FOREACH (fctx->altfinds, find, publink) {
|
||||
ISC_LIST_UNLINK(fctx->altfinds, find, publink);
|
||||
dns_adb_destroyfind(&find);
|
||||
fetchctx_unref(fctx);
|
||||
}
|
||||
fctx->altfind = NULL;
|
||||
|
||||
ISC_LIST_FOREACH_SAFE (fctx->forwaddrs, addr, publink) {
|
||||
ISC_LIST_FOREACH (fctx->forwaddrs, addr, publink) {
|
||||
ISC_LIST_UNLINK(fctx->forwaddrs, addr, publink);
|
||||
dns_adb_freeaddrinfo(fctx->adb, &addr);
|
||||
}
|
||||
|
||||
ISC_LIST_FOREACH_SAFE (fctx->altaddrs, addr, publink) {
|
||||
ISC_LIST_FOREACH (fctx->altaddrs, addr, publink) {
|
||||
ISC_LIST_UNLINK(fctx->altaddrs, addr, publink);
|
||||
dns_adb_freeaddrinfo(fctx->adb, &addr);
|
||||
}
|
||||
@ -1306,7 +1306,7 @@ fctx_cancelqueries(fetchctx_t *fctx, bool no_response, bool age_untried) {
|
||||
ISC_LIST_MOVE(queries, fctx->queries);
|
||||
UNLOCK(&fctx->lock);
|
||||
|
||||
ISC_LIST_FOREACH_SAFE (queries, query, link) {
|
||||
ISC_LIST_FOREACH (queries, query, link) {
|
||||
/*
|
||||
* Note that we have to unlink the query here,
|
||||
* because if it's still linked in fctx_cancelquery(),
|
||||
@ -1516,7 +1516,7 @@ fctx_sendevents(fetchctx_t *fctx, isc_result_t result) {
|
||||
now = isc_time_now();
|
||||
fctx->duration = isc_time_microdiff(&now, &fctx->start);
|
||||
|
||||
ISC_LIST_FOREACH_SAFE (fctx->resps, resp, link) {
|
||||
ISC_LIST_FOREACH (fctx->resps, resp, link) {
|
||||
ISC_LIST_UNLINK(fctx->resps, resp, link);
|
||||
|
||||
count++;
|
||||
@ -4369,12 +4369,12 @@ fctx_destroy(fetchctx_t *fctx) {
|
||||
dec_stats(res, dns_resstatscounter_nfetch);
|
||||
|
||||
/* Free bad */
|
||||
ISC_LIST_FOREACH_SAFE (fctx->bad, sa, link) {
|
||||
ISC_LIST_FOREACH (fctx->bad, sa, link) {
|
||||
ISC_LIST_UNLINK(fctx->bad, sa, link);
|
||||
isc_mem_put(fctx->mctx, sa, sizeof(*sa));
|
||||
}
|
||||
|
||||
ISC_LIST_FOREACH_SAFE (fctx->edns, tried, link) {
|
||||
ISC_LIST_FOREACH (fctx->edns, tried, link) {
|
||||
ISC_LIST_UNLINK(fctx->edns, tried, link);
|
||||
isc_mem_put(fctx->mctx, tried, sizeof(*tried));
|
||||
}
|
||||
@ -10485,7 +10485,7 @@ dns_resolver_cancelfetch(dns_fetch_t *fetch) {
|
||||
* the callback asynchronously with a ISC_R_CANCELED result.
|
||||
*/
|
||||
if (fctx->state != fetchstate_done) {
|
||||
ISC_LIST_FOREACH_SAFE (fctx->resps, resp, link) {
|
||||
ISC_LIST_FOREACH (fctx->resps, resp, link) {
|
||||
if (resp->fetch == fetch) {
|
||||
resp->result = ISC_R_CANCELED;
|
||||
ISC_LIST_UNLINK(fctx->resps, resp, link);
|
||||
@ -10530,7 +10530,7 @@ dns_resolver_destroyfetch(dns_fetch_t **fetchp) {
|
||||
* trying to destroy the fetch.
|
||||
*/
|
||||
if (fctx->state != fetchstate_done) {
|
||||
ISC_LIST_FOREACH_SAFE (fctx->resps, resp, link) {
|
||||
ISC_LIST_FOREACH (fctx->resps, resp, link) {
|
||||
RUNTIME_CHECK(resp->fetch != fetch);
|
||||
}
|
||||
}
|
||||
|
@ -268,7 +268,7 @@ free_old_hash(dns_rrl_t *rrl) {
|
||||
for (old_bin = &old_hash->bins[0];
|
||||
old_bin < &old_hash->bins[old_hash->length]; ++old_bin)
|
||||
{
|
||||
ISC_LIST_FOREACH_SAFE (*old_bin, e, hlink) {
|
||||
ISC_LIST_FOREACH (*old_bin, e, hlink) {
|
||||
ISC_LINK_INIT(e, hlink);
|
||||
}
|
||||
}
|
||||
@ -1281,7 +1281,7 @@ dns_rrl_view_destroy(dns_view_t *view) {
|
||||
|
||||
isc_mutex_destroy(&rrl->lock);
|
||||
|
||||
ISC_LIST_FOREACH_SAFE (rrl->blocks, b, link) {
|
||||
ISC_LIST_FOREACH (rrl->blocks, b, link) {
|
||||
ISC_LIST_UNLINK(rrl->blocks, b, link);
|
||||
isc_mem_put(rrl->mctx, b, b->size);
|
||||
}
|
||||
|
@ -166,7 +166,7 @@ dns_skrbundle_getsig(dns_skrbundle_t *bundle, dst_key_t *key,
|
||||
REQUIRE(DNS_SKRBUNDLE_VALID(bundle));
|
||||
REQUIRE(DNS_DIFF_VALID(&bundle->diff));
|
||||
|
||||
ISC_LIST_FOREACH_SAFE (bundle->diff.tuples, tuple, link) {
|
||||
ISC_LIST_FOREACH (bundle->diff.tuples, tuple, link) {
|
||||
dns_rdata_rrsig_t rrsig;
|
||||
|
||||
if (tuple->op != DNS_DIFFOP_ADDRESIGN) {
|
||||
@ -429,7 +429,7 @@ void
|
||||
dns_skr_destroy(dns_skr_t *skr) {
|
||||
REQUIRE(DNS_SKR_VALID(skr));
|
||||
|
||||
ISC_LIST_FOREACH_SAFE (skr->bundles, b, link) {
|
||||
ISC_LIST_FOREACH (skr->bundles, b, link) {
|
||||
ISC_LIST_UNLINK(skr->bundles, b, link);
|
||||
dns_diff_clear(&b->diff);
|
||||
isc_mem_put(skr->mctx, b, sizeof(*b));
|
||||
|
@ -82,7 +82,7 @@ destroy(dns_ssutable_t *table) {
|
||||
REQUIRE(VALID_SSUTABLE(table));
|
||||
|
||||
mctx = table->mctx;
|
||||
ISC_LIST_FOREACH_SAFE (table->rules, rule, link) {
|
||||
ISC_LIST_FOREACH (table->rules, rule, link) {
|
||||
if (rule->identity != NULL) {
|
||||
dns_name_free(rule->identity, mctx);
|
||||
isc_mem_put(mctx, rule->identity,
|
||||
|
@ -154,9 +154,9 @@ add_rdata_to_list(dns_message_t *msg, dns_name_t *name, dns_rdata_t *rdata,
|
||||
|
||||
static void
|
||||
free_namelist(dns_message_t *msg, dns_namelist_t *namelist) {
|
||||
ISC_LIST_FOREACH_SAFE (*namelist, name, link) {
|
||||
ISC_LIST_FOREACH (*namelist, name, link) {
|
||||
ISC_LIST_UNLINK(*namelist, name, link);
|
||||
ISC_LIST_FOREACH_SAFE (name->list, set, link) {
|
||||
ISC_LIST_FOREACH (name->list, set, link) {
|
||||
ISC_LIST_UNLINK(name->list, set, link);
|
||||
if (dns_rdataset_isassociated(set)) {
|
||||
dns_rdataset_disassociate(set);
|
||||
@ -504,7 +504,7 @@ dns_tkey_processquery(dns_message_t *msg, dns_tkeyctx_t *tctx,
|
||||
RETERR(dns_message_reply(msg, true));
|
||||
add_rdata_to_list(msg, keyname, &rdata, 0, &namelist);
|
||||
|
||||
ISC_LIST_FOREACH_SAFE (namelist, name, link) {
|
||||
ISC_LIST_FOREACH (namelist, name, link) {
|
||||
ISC_LIST_UNLINK(namelist, name, link);
|
||||
dns_message_addname(msg, name, DNS_SECTION_ANSWER);
|
||||
}
|
||||
|
@ -814,7 +814,7 @@ uniqify_name_list(dns_diff_t *list) {
|
||||
CHECK(dns_diff_sort(list, name_order));
|
||||
|
||||
dns_name_t *curr_name = NULL;
|
||||
ISC_LIST_FOREACH_SAFE (list->tuples, p, link) {
|
||||
ISC_LIST_FOREACH (list->tuples, p, link) {
|
||||
if (curr_name == NULL || !dns_name_equal(curr_name, &p->name)) {
|
||||
curr_name = &(p->name);
|
||||
} else {
|
||||
@ -1065,7 +1065,7 @@ find_zone_keys(dns_zone_t *zone, isc_mem_t *mctx, unsigned int maxkeys,
|
||||
}
|
||||
|
||||
/* Add new 'dnskeys' to 'keys' */
|
||||
ISC_LIST_FOREACH_SAFE (keylist, k, link) {
|
||||
ISC_LIST_FOREACH (keylist, k, link) {
|
||||
if (count >= maxkeys) {
|
||||
ISC_LIST_UNLINK(keylist, k, link);
|
||||
dns_dnsseckey_destroy(mctx, &k);
|
||||
@ -1828,7 +1828,7 @@ next_state:
|
||||
* contents to indicate that their respective owner names
|
||||
* should be part of the NSEC chain.
|
||||
*/
|
||||
ISC_LIST_FOREACH_SAFE (state->affected.tuples, t, link) {
|
||||
ISC_LIST_FOREACH (state->affected.tuples, t, link) {
|
||||
bool exists;
|
||||
dns_name_t *name = &t->name;
|
||||
|
||||
@ -1923,7 +1923,7 @@ next_state:
|
||||
* have to regenerate the RRSIG NSECs for NSECs that were
|
||||
* replaced with identical ones.
|
||||
*/
|
||||
ISC_LIST_FOREACH_SAFE (state->nsec_diff.tuples, t, link) {
|
||||
ISC_LIST_FOREACH (state->nsec_diff.tuples, t, link) {
|
||||
ISC_LIST_UNLINK(state->nsec_diff.tuples, t, link);
|
||||
dns_diff_appendminimal(&state->nsec_mindiff, &t);
|
||||
}
|
||||
@ -1935,7 +1935,7 @@ next_state:
|
||||
case sign_nsec:
|
||||
state->state = sign_nsec;
|
||||
/* Update RRSIG NSECs. */
|
||||
ISC_LIST_FOREACH_SAFE (state->nsec_mindiff.tuples, t, link) {
|
||||
ISC_LIST_FOREACH (state->nsec_mindiff.tuples, t, link) {
|
||||
if (t->op == DNS_DIFFOP_DEL) {
|
||||
CHECK(delete_if(true_p, db, newver, &t->name,
|
||||
dns_rdatatype_rrsig,
|
||||
@ -1965,11 +1965,11 @@ next_state:
|
||||
state->state = update_nsec3;
|
||||
|
||||
/* Record our changes for the journal. */
|
||||
ISC_LIST_FOREACH_SAFE (state->sig_diff.tuples, t, link) {
|
||||
ISC_LIST_FOREACH (state->sig_diff.tuples, t, link) {
|
||||
ISC_LIST_UNLINK(state->sig_diff.tuples, t, link);
|
||||
dns_diff_appendminimal(diff, &t);
|
||||
}
|
||||
ISC_LIST_FOREACH_SAFE (state->nsec_mindiff.tuples, t, link) {
|
||||
ISC_LIST_FOREACH (state->nsec_mindiff.tuples, t, link) {
|
||||
ISC_LIST_UNLINK(state->nsec_mindiff.tuples, t, link);
|
||||
dns_diff_appendminimal(diff, &t);
|
||||
}
|
||||
@ -2057,7 +2057,7 @@ next_state:
|
||||
FALLTHROUGH;
|
||||
case process_nsec3:
|
||||
state->state = process_nsec3;
|
||||
ISC_LIST_FOREACH_SAFE (state->affected.tuples, t, link) {
|
||||
ISC_LIST_FOREACH (state->affected.tuples, t, link) {
|
||||
dns_name_t *name = &t->name;
|
||||
|
||||
unsecure = false; /* Silence compiler warning. */
|
||||
@ -2097,7 +2097,7 @@ next_state:
|
||||
* have to regenerate the RRSIG NSEC3s for NSEC3s that were
|
||||
* replaced with identical ones.
|
||||
*/
|
||||
ISC_LIST_FOREACH_SAFE (state->nsec_diff.tuples, t, link) {
|
||||
ISC_LIST_FOREACH (state->nsec_diff.tuples, t, link) {
|
||||
ISC_LIST_UNLINK(state->nsec_diff.tuples, t, link);
|
||||
dns_diff_appendminimal(&state->nsec_mindiff, &t);
|
||||
}
|
||||
@ -2109,7 +2109,7 @@ next_state:
|
||||
case sign_nsec3:
|
||||
state->state = sign_nsec3;
|
||||
/* Update RRSIG NSEC3s. */
|
||||
ISC_LIST_FOREACH_SAFE (state->nsec_mindiff.tuples, t, link) {
|
||||
ISC_LIST_FOREACH (state->nsec_mindiff.tuples, t, link) {
|
||||
if (t->op == DNS_DIFFOP_DEL) {
|
||||
CHECK(delete_if(true_p, db, newver, &t->name,
|
||||
dns_rdatatype_rrsig,
|
||||
@ -2136,11 +2136,11 @@ next_state:
|
||||
state->work.tuples, link);
|
||||
|
||||
/* Record our changes for the journal. */
|
||||
ISC_LIST_FOREACH_SAFE (state->sig_diff.tuples, t, link) {
|
||||
ISC_LIST_FOREACH (state->sig_diff.tuples, t, link) {
|
||||
ISC_LIST_UNLINK(state->sig_diff.tuples, t, link);
|
||||
dns_diff_appendminimal(diff, &t);
|
||||
}
|
||||
ISC_LIST_FOREACH_SAFE (state->nsec_mindiff.tuples, t, link) {
|
||||
ISC_LIST_FOREACH (state->nsec_mindiff.tuples, t, link) {
|
||||
ISC_LIST_UNLINK(state->nsec_mindiff.tuples, t, link);
|
||||
dns_diff_appendminimal(diff, &t);
|
||||
}
|
||||
|
@ -232,11 +232,11 @@ destroy(dns_view_t *view) {
|
||||
dns_catz_zones_shutdown(view->catzs);
|
||||
dns_catz_zones_detach(&view->catzs);
|
||||
}
|
||||
ISC_LIST_FOREACH_SAFE (view->dlz_searched, dlzdb, link) {
|
||||
ISC_LIST_FOREACH (view->dlz_searched, dlzdb, link) {
|
||||
ISC_LIST_UNLINK(view->dlz_searched, dlzdb, link);
|
||||
dns_dlzdestroy(&dlzdb);
|
||||
}
|
||||
ISC_LIST_FOREACH_SAFE (view->dlz_unsearched, dlzdb, link) {
|
||||
ISC_LIST_FOREACH (view->dlz_unsearched, dlzdb, link) {
|
||||
ISC_LIST_UNLINK(view->dlz_unsearched, dlzdb, link);
|
||||
dns_dlzdestroy(&dlzdb);
|
||||
}
|
||||
|
@ -1224,7 +1224,7 @@ dns_zone_create(dns_zone_t **zonep, isc_mem_t *mctx, unsigned int tid) {
|
||||
|
||||
static void
|
||||
clear_keylist(dns_dnsseckeylist_t *list, isc_mem_t *mctx) {
|
||||
ISC_LIST_FOREACH_SAFE (*list, key, link) {
|
||||
ISC_LIST_FOREACH (*list, key, link) {
|
||||
ISC_LIST_UNLINK(*list, key, link);
|
||||
dns_dnsseckey_destroy(mctx, &key);
|
||||
}
|
||||
@ -1255,32 +1255,32 @@ zone_free(dns_zone_t *zone) {
|
||||
INSIST(zone->prev_view == NULL);
|
||||
|
||||
/* Unmanaged objects */
|
||||
ISC_LIST_FOREACH_SAFE (zone->setnsec3param_queue, npe, link) {
|
||||
ISC_LIST_FOREACH (zone->setnsec3param_queue, npe, link) {
|
||||
ISC_LIST_UNLINK(zone->setnsec3param_queue, npe, link);
|
||||
isc_mem_put(zone->mctx, npe, sizeof(*npe));
|
||||
}
|
||||
|
||||
ISC_LIST_FOREACH_SAFE (zone->signing, signing, link) {
|
||||
ISC_LIST_FOREACH (zone->signing, signing, link) {
|
||||
ISC_LIST_UNLINK(zone->signing, signing, link);
|
||||
dns_db_detach(&signing->db);
|
||||
dns_dbiterator_destroy(&signing->dbiterator);
|
||||
isc_mem_put(zone->mctx, signing, sizeof *signing);
|
||||
}
|
||||
|
||||
ISC_LIST_FOREACH_SAFE (zone->nsec3chain, nsec3chain, link) {
|
||||
ISC_LIST_FOREACH (zone->nsec3chain, nsec3chain, link) {
|
||||
ISC_LIST_UNLINK(zone->nsec3chain, nsec3chain, link);
|
||||
dns_db_detach(&nsec3chain->db);
|
||||
dns_dbiterator_destroy(&nsec3chain->dbiterator);
|
||||
isc_mem_put(zone->mctx, nsec3chain, sizeof *nsec3chain);
|
||||
}
|
||||
|
||||
ISC_LIST_FOREACH_SAFE (zone->includes, include, link) {
|
||||
ISC_LIST_FOREACH (zone->includes, include, link) {
|
||||
ISC_LIST_UNLINK(zone->includes, include, link);
|
||||
isc_mem_free(zone->mctx, include->name);
|
||||
isc_mem_put(zone->mctx, include, sizeof *include);
|
||||
}
|
||||
|
||||
ISC_LIST_FOREACH_SAFE (zone->newincludes, include, link) {
|
||||
ISC_LIST_FOREACH (zone->newincludes, include, link) {
|
||||
ISC_LIST_UNLINK(zone->newincludes, include, link);
|
||||
isc_mem_free(zone->mctx, include->name);
|
||||
isc_mem_put(zone->mctx, include, sizeof *include);
|
||||
@ -4904,7 +4904,7 @@ zone_unchanged(dns_db_t *db1, dns_db_t *db2, isc_mem_t *mctx) {
|
||||
|
||||
static void
|
||||
process_zone_setnsec3param(dns_zone_t *zone) {
|
||||
ISC_LIST_FOREACH_SAFE (zone->setnsec3param_queue, npe, link) {
|
||||
ISC_LIST_FOREACH (zone->setnsec3param_queue, npe, link) {
|
||||
ISC_LIST_UNLINK(zone->setnsec3param_queue, npe, link);
|
||||
zone_iattach(zone, &npe->zone);
|
||||
isc_async_run(zone->loop, setnsec3param, npe);
|
||||
@ -5452,7 +5452,7 @@ zone_postload(dns_zone_t *zone, dns_db_t *db, isc_time_t loadtime,
|
||||
/*
|
||||
* Clear old include list.
|
||||
*/
|
||||
ISC_LIST_FOREACH_SAFE (zone->includes, inc, link) {
|
||||
ISC_LIST_FOREACH (zone->includes, inc, link) {
|
||||
ISC_LIST_UNLINK(zone->includes, inc, link);
|
||||
isc_mem_free(zone->mctx, inc->name);
|
||||
isc_mem_put(zone->mctx, inc, sizeof(*inc));
|
||||
@ -5462,7 +5462,7 @@ zone_postload(dns_zone_t *zone, dns_db_t *db, isc_time_t loadtime,
|
||||
/*
|
||||
* Transfer new include list.
|
||||
*/
|
||||
ISC_LIST_FOREACH_SAFE (zone->newincludes, inc, link) {
|
||||
ISC_LIST_FOREACH (zone->newincludes, inc, link) {
|
||||
ISC_LIST_UNLINK(zone->newincludes, inc, link);
|
||||
ISC_LIST_APPEND(zone->includes, inc, link);
|
||||
zone->nincludes++;
|
||||
@ -5488,7 +5488,7 @@ cleanup:
|
||||
dns_zone_catz_disable_db(zone, db);
|
||||
}
|
||||
|
||||
ISC_LIST_FOREACH_SAFE (zone->newincludes, inc, link) {
|
||||
ISC_LIST_FOREACH (zone->newincludes, inc, link) {
|
||||
ISC_LIST_UNLINK(zone->newincludes, inc, link);
|
||||
isc_mem_free(zone->mctx, inc->name);
|
||||
isc_mem_put(zone->mctx, inc, sizeof(*inc));
|
||||
@ -6646,7 +6646,7 @@ dns_zone_getdnsseckeys(dns_zone_t *zone, dns_db_t *db, dns_dbversion_t *ver,
|
||||
}
|
||||
|
||||
/* Add new 'dnskeys' to 'keys'. */
|
||||
ISC_LIST_FOREACH_SAFE (dnskeys, k1, link) {
|
||||
ISC_LIST_FOREACH (dnskeys, k1, link) {
|
||||
bool match = false;
|
||||
|
||||
ISC_LIST_FOREACH (*keys, k2, link) {
|
||||
@ -6670,7 +6670,7 @@ failure:
|
||||
if (node != NULL) {
|
||||
dns_db_detachnode(db, &node);
|
||||
}
|
||||
ISC_LIST_FOREACH_SAFE (dnskeys, key, link) {
|
||||
ISC_LIST_FOREACH (dnskeys, key, link) {
|
||||
ISC_LIST_UNLINK(dnskeys, key, link);
|
||||
dns_dnsseckey_destroy(dns_zone_getmctx(zone), &key);
|
||||
}
|
||||
@ -9222,7 +9222,7 @@ done:
|
||||
/*
|
||||
* Everything succeeded so we can clean these up now.
|
||||
*/
|
||||
ISC_LIST_FOREACH_SAFE (cleanup, chain, link) {
|
||||
ISC_LIST_FOREACH (cleanup, chain, link) {
|
||||
ISC_LIST_UNLINK(cleanup, chain, link);
|
||||
dns_db_detach(&chain->db);
|
||||
dns_dbiterator_destroy(&chain->dbiterator);
|
||||
@ -9258,7 +9258,7 @@ failure:
|
||||
/*
|
||||
* Rollback the cleanup list.
|
||||
*/
|
||||
ISC_LIST_FOREACH_REV_SAFE (cleanup, chain, link) {
|
||||
ISC_LIST_FOREACH_REV (cleanup, chain, link) {
|
||||
ISC_LIST_UNLINK(cleanup, chain, link);
|
||||
if (chain->done) {
|
||||
dns_db_detach(&chain->db);
|
||||
@ -10004,7 +10004,7 @@ pauseall:
|
||||
/*
|
||||
* Everything succeeded so we can clean these up now.
|
||||
*/
|
||||
ISC_LIST_FOREACH_SAFE (cleanup, s, link) {
|
||||
ISC_LIST_FOREACH (cleanup, s, link) {
|
||||
ISC_LIST_UNLINK(cleanup, s, link);
|
||||
dns_db_detach(&s->db);
|
||||
dns_dbiterator_destroy(&s->dbiterator);
|
||||
@ -13701,7 +13701,7 @@ save_nsrrset(dns_message_t *message, dns_name_t *name,
|
||||
result = ISC_R_SUCCESS;
|
||||
|
||||
done:
|
||||
ISC_LIST_FOREACH_SAFE (ns_list, ns_name, link) {
|
||||
ISC_LIST_FOREACH (ns_list, ns_name, link) {
|
||||
ISC_LIST_UNLINK(ns_list, ns_name, link);
|
||||
dns_name_free(ns_name, cb_args->stub->mctx);
|
||||
isc_mem_put(cb_args->stub->mctx, ns_name, sizeof(*ns_name));
|
||||
@ -16554,7 +16554,7 @@ dns_zone_dnskey_inuse(dns_zone_t *zone, dns_rdata_t *rdata, bool *inuse) {
|
||||
break;
|
||||
}
|
||||
|
||||
ISC_LIST_FOREACH_SAFE (keylist, key, link) {
|
||||
ISC_LIST_FOREACH (keylist, key, link) {
|
||||
ISC_LIST_UNLINK(keylist, key, link);
|
||||
dns_dnsseckey_destroy(mctx, &key);
|
||||
}
|
||||
@ -16803,7 +16803,7 @@ sync_secure_db(dns_zone_t *seczone, dns_zone_t *raw, dns_db_t *secdb,
|
||||
dns_db_detachnode(secdb, &node);
|
||||
}
|
||||
|
||||
ISC_LIST_FOREACH_SAFE (diff->tuples, tuple, link) {
|
||||
ISC_LIST_FOREACH (diff->tuples, tuple, link) {
|
||||
dns_difftuplelist_t *al = &add, *dl = &del;
|
||||
|
||||
/*
|
||||
@ -17358,7 +17358,7 @@ getprivate:
|
||||
*/
|
||||
rdata.data[1] = 0;
|
||||
|
||||
ISC_LIST_FOREACH_SAFE (*nsec3list, nsec3p, link) {
|
||||
ISC_LIST_FOREACH (*nsec3list, nsec3p, link) {
|
||||
if (nsec3p->length ==
|
||||
(unsigned int)rdata.length + 1 &&
|
||||
memcmp(rdata.data, nsec3p->data + 1,
|
||||
@ -17430,7 +17430,7 @@ restore_nsec3param(dns_zone_t *zone, dns_db_t *db, dns_dbversion_t *version,
|
||||
* and CREATE flags, and the add the record to the apex of the tree
|
||||
* in db.
|
||||
*/
|
||||
ISC_LIST_FOREACH_SAFE (*nsec3list, nsec3p, link) {
|
||||
ISC_LIST_FOREACH (*nsec3list, nsec3p, link) {
|
||||
dns_rdata_init(&rdata);
|
||||
nsec3p->data[2] = DNS_NSEC3FLAG_CREATE | DNS_NSEC3FLAG_INITIAL;
|
||||
rdata.length = nsec3p->length;
|
||||
@ -19454,7 +19454,7 @@ dns_zonemgr_gettransfersperns(dns_zonemgr_t *zmgr) {
|
||||
*/
|
||||
static void
|
||||
zmgr_resume_xfrs(dns_zonemgr_t *zmgr, bool multi) {
|
||||
ISC_LIST_FOREACH_SAFE (zmgr->waiting_for_xfrin, zone, statelink) {
|
||||
ISC_LIST_FOREACH (zmgr->waiting_for_xfrin, zone, statelink) {
|
||||
isc_result_t result;
|
||||
result = zmgr_start_xfrin_ifquota(zmgr, zone);
|
||||
if (result == ISC_R_SUCCESS) {
|
||||
@ -20506,7 +20506,7 @@ add_signing_records(dns_db_t *db, dns_rdatatype_t privatetype,
|
||||
* Move non DNSKEY and not DNSSEC DNSKEY records to tuples
|
||||
* and sort the remaining DNSKEY records to add and del.
|
||||
*/
|
||||
ISC_LIST_FOREACH_SAFE (diff->tuples, tuple, link) {
|
||||
ISC_LIST_FOREACH (diff->tuples, tuple, link) {
|
||||
if (tuple->rdata.type != dns_rdatatype_dnskey) {
|
||||
ISC_LIST_UNLINK(diff->tuples, tuple, link);
|
||||
ISC_LIST_APPEND(tuples, tuple, link);
|
||||
@ -20546,7 +20546,7 @@ add_signing_records(dns_db_t *db, dns_rdatatype_t privatetype,
|
||||
/*
|
||||
* Filter out DNSKEY TTL changes and put them back onto diff->tuples.
|
||||
*/
|
||||
ISC_LIST_FOREACH_SAFE (del, deltuple, link) {
|
||||
ISC_LIST_FOREACH (del, deltuple, link) {
|
||||
ISC_LIST_FOREACH (add, addtuple, link) {
|
||||
int n = dns_rdata_compare(&deltuple->rdata,
|
||||
&addtuple->rdata);
|
||||
@ -21192,7 +21192,7 @@ failure:
|
||||
dns_db_detach(&db);
|
||||
}
|
||||
|
||||
ISC_LIST_FOREACH_SAFE (keys, key, link) {
|
||||
ISC_LIST_FOREACH (keys, key, link) {
|
||||
ISC_LIST_UNLINK(keys, key, link);
|
||||
dns_dnsseckey_destroy(dns_zone_getmctx(zone), &key);
|
||||
}
|
||||
@ -22105,7 +22105,7 @@ zone_verifykeys(dns_zone_t *zone, dns_dnsseckeylist_t *newkeys) {
|
||||
/*
|
||||
* Make sure that the existing keys are also present in the new keylist.
|
||||
*/
|
||||
ISC_LIST_FOREACH_SAFE (zone->keyring, key1, link) {
|
||||
ISC_LIST_FOREACH (zone->keyring, key1, link) {
|
||||
bool found = false;
|
||||
|
||||
if (dst_key_is_unused(key1->key)) {
|
||||
@ -22910,7 +22910,7 @@ zone_rekey(dns_zone_t *zone) {
|
||||
clear_keylist(&zone->keyring, zone->mctx);
|
||||
}
|
||||
|
||||
ISC_LIST_FOREACH_SAFE (dnskeys, key, link) {
|
||||
ISC_LIST_FOREACH (dnskeys, key, link) {
|
||||
if (isc_log_wouldlog(ISC_LOG_DEBUG(3))) {
|
||||
/* This debug log is used in the kasp system test */
|
||||
char algbuf[DNS_SECALG_FORMATSIZE];
|
||||
|
@ -290,7 +290,7 @@ destroy_httpdmgr(isc_httpdmgr_t *httpdmgr) {
|
||||
* Clear out the list of all actions we know about. Just free the
|
||||
* memory.
|
||||
*/
|
||||
ISC_LIST_FOREACH_SAFE (httpdmgr->urls, url, link) {
|
||||
ISC_LIST_FOREACH (httpdmgr->urls, url, link) {
|
||||
isc_mem_free(httpdmgr->mctx, url->url);
|
||||
ISC_LIST_UNLINK(httpdmgr->urls, url, link);
|
||||
isc_mem_put(httpdmgr->mctx, url, sizeof(isc_httpdurl_t));
|
||||
@ -978,7 +978,7 @@ isc_httpdmgr_shutdown(isc_httpdmgr_t **httpdmgrp) {
|
||||
|
||||
LOCK(&httpdmgr->lock);
|
||||
|
||||
ISC_LIST_FOREACH_SAFE (httpdmgr->running, httpd, link) {
|
||||
ISC_LIST_FOREACH (httpdmgr->running, httpd, link) {
|
||||
if (httpd->handle != NULL) {
|
||||
httpd_request(httpd->handle, ISC_R_SUCCESS, NULL,
|
||||
httpd);
|
||||
|
@ -230,14 +230,7 @@
|
||||
}
|
||||
|
||||
/* clang-format off */
|
||||
#define ISC_LIST_FOREACH(list, elt, link) \
|
||||
for (typeof((list).head) elt = ISC_LIST_HEAD(list); \
|
||||
elt != NULL; \
|
||||
elt = ISC_LIST_NEXT(elt, link))
|
||||
/* clang-format on */
|
||||
|
||||
/* clang-format off */
|
||||
#define ISC_LIST_FOREACH_SAFE(list, elt, link) \
|
||||
#define ISC_LIST_FOREACH(list, elt, link) \
|
||||
for (typeof((list).head) elt = ISC_LIST_HEAD(list), \
|
||||
elt##_next = (elt != NULL) ? ISC_LIST_NEXT(elt, link) : NULL; \
|
||||
elt != NULL; \
|
||||
@ -246,14 +239,7 @@
|
||||
/* clang-format on */
|
||||
|
||||
/* clang-format off */
|
||||
#define ISC_LIST_FOREACH_REV(list, elt, link) \
|
||||
for (typeof((list).tail) elt = ISC_LIST_TAIL(list); \
|
||||
elt != NULL; \
|
||||
elt = ISC_LIST_PREV(elt, link))
|
||||
/* clang-format on */
|
||||
|
||||
/* clang-format off */
|
||||
#define ISC_LIST_FOREACH_REV_SAFE(list, elt, link) \
|
||||
#define ISC_LIST_FOREACH_REV(list, elt, link) \
|
||||
for (typeof((list).tail) elt = ISC_LIST_TAIL(list), \
|
||||
elt##_prev = (elt != NULL) ? ISC_LIST_PREV(elt, link) : NULL; \
|
||||
elt != NULL; \
|
||||
|
@ -64,7 +64,7 @@ isc__job_cb(uv_idle_t *handle) {
|
||||
|
||||
ISC_LIST_MOVE(jobs, loop->run_jobs);
|
||||
|
||||
ISC_LIST_FOREACH_SAFE (jobs, job, link) {
|
||||
ISC_LIST_FOREACH (jobs, job, link) {
|
||||
isc_job_cb cb = job->cb;
|
||||
void *cbarg = job->cbarg;
|
||||
ISC_LIST_UNLINK(jobs, job, link);
|
||||
|
@ -413,7 +413,7 @@ isc_logconfig_destroy(isc_logconfig_t **lcfgp) {
|
||||
|
||||
mctx = lcfg->lctx->mctx;
|
||||
|
||||
ISC_LIST_FOREACH_SAFE (lcfg->channels, channel, link) {
|
||||
ISC_LIST_FOREACH (lcfg->channels, channel, link) {
|
||||
if (channel->type == ISC_LOG_TOFILE) {
|
||||
/*
|
||||
* The filename for the channel may have ultimately
|
||||
@ -434,7 +434,7 @@ isc_logconfig_destroy(isc_logconfig_t **lcfgp) {
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < ARRAY_SIZE(lcfg->channellists); i++) {
|
||||
ISC_LIST_FOREACH_SAFE (lcfg->channellists[i], item, link) {
|
||||
ISC_LIST_FOREACH (lcfg->channellists[i], item, link) {
|
||||
ISC_LIST_UNLINK(lcfg->channellists[i], item, link);
|
||||
isc_mem_put(mctx, item, sizeof(*item));
|
||||
}
|
||||
|
@ -524,7 +524,7 @@ mem_destroy(isc_mem_t *ctx) {
|
||||
#if ISC_MEM_TRACKLINES
|
||||
if (ctx->debuglist != NULL) {
|
||||
for (size_t i = 0; i < DEBUG_TABLE_COUNT; i++) {
|
||||
ISC_LIST_FOREACH_SAFE (ctx->debuglist[i], dl, link) {
|
||||
ISC_LIST_FOREACH (ctx->debuglist[i], dl, link) {
|
||||
if (ctx->checkfree && dl->ptr != NULL) {
|
||||
print_active(ctx, stderr);
|
||||
}
|
||||
|
@ -1311,7 +1311,7 @@ done:
|
||||
static void
|
||||
call_pending_callbacks(isc__nm_http_pending_callbacks_t pending_callbacks,
|
||||
isc_result_t result) {
|
||||
ISC_LIST_FOREACH_SAFE (pending_callbacks, cbreq, link) {
|
||||
ISC_LIST_FOREACH (pending_callbacks, cbreq, link) {
|
||||
ISC_LIST_UNLINK(pending_callbacks, cbreq, link);
|
||||
isc__nm_sendcb(cbreq->handle->sock, cbreq, result, true);
|
||||
}
|
||||
@ -3051,7 +3051,7 @@ isc_nm_http_endpoints_detach(isc_nm_http_endpoints_t **restrict epsp) {
|
||||
mctx = eps->mctx;
|
||||
|
||||
/* Delete all handlers */
|
||||
ISC_LIST_FOREACH_SAFE (eps->handlers, handler, link) {
|
||||
ISC_LIST_FOREACH (eps->handlers, handler, link) {
|
||||
ISC_LIST_DEQUEUE(eps->handlers, handler, link);
|
||||
isc_mem_free(mctx, handler->path);
|
||||
handler->magic = 0;
|
||||
@ -3218,7 +3218,7 @@ client_call_failed_read_cb(isc_result_t result,
|
||||
REQUIRE(VALID_HTTP2_SESSION(session));
|
||||
REQUIRE(result != ISC_R_SUCCESS);
|
||||
|
||||
ISC_LIST_FOREACH_SAFE (session->cstreams, cstream, link) {
|
||||
ISC_LIST_FOREACH (session->cstreams, cstream, link) {
|
||||
/*
|
||||
* read_cb could be NULL if cstream was allocated and added
|
||||
* to the tracking list, but was not properly initialized due
|
||||
@ -3252,7 +3252,7 @@ server_call_failed_read_cb(isc_result_t result,
|
||||
failed_httpstream_read_cb(h2data->psock, result, session);
|
||||
}
|
||||
|
||||
ISC_LIST_FOREACH_SAFE (session->sstreams, h2data, link) {
|
||||
ISC_LIST_FOREACH (session->sstreams, h2data, link) {
|
||||
ISC_LIST_DEQUEUE(session->sstreams, h2data, link);
|
||||
|
||||
/* Cleanup socket in place */
|
||||
|
@ -512,7 +512,7 @@ nmsocket_cleanup(void *arg) {
|
||||
isc__nmsocket_detach(&sock->outer);
|
||||
}
|
||||
|
||||
ISC_LIST_FOREACH_SAFE (sock->inactive_handles, handle, inactive_link) {
|
||||
ISC_LIST_FOREACH (sock->inactive_handles, handle, inactive_link) {
|
||||
ISC_LIST_DEQUEUE(sock->inactive_handles, handle, inactive_link);
|
||||
nmhandle_free(sock, handle);
|
||||
}
|
||||
|
@ -262,7 +262,7 @@ isc__ratelimiter_tick(void *arg) {
|
||||
unlock:
|
||||
UNLOCK(&rl->lock);
|
||||
|
||||
ISC_LIST_FOREACH_SAFE (pending, rle, link) {
|
||||
ISC_LIST_FOREACH (pending, rle, link) {
|
||||
ISC_LIST_UNLINK(pending, rle, link);
|
||||
isc_async_run(rle->loop, rle->cb, rle->arg);
|
||||
}
|
||||
@ -302,7 +302,7 @@ isc_ratelimiter_shutdown(isc_ratelimiter_t *restrict rl) {
|
||||
}
|
||||
UNLOCK(&rl->lock);
|
||||
|
||||
ISC_LIST_FOREACH_SAFE (pending, rle, link) {
|
||||
ISC_LIST_FOREACH (pending, rle, link) {
|
||||
ISC_LIST_UNLINK(pending, rle, link);
|
||||
rle->canceled = true;
|
||||
isc_async_run(rl->loop, rle->cb, rle->arg);
|
||||
|
@ -1354,7 +1354,7 @@ isc_tlsctx_client_session_cache_detach(
|
||||
|
||||
isc_refcount_destroy(&cache->references);
|
||||
|
||||
ISC_LIST_FOREACH_SAFE (cache->lru_entries, entry, cache_link) {
|
||||
ISC_LIST_FOREACH (cache->lru_entries, entry, cache_link) {
|
||||
client_cache_entry_delete(cache, entry);
|
||||
}
|
||||
|
||||
|
@ -76,8 +76,7 @@ cfg_aclconfctx_detach(cfg_aclconfctx_t **actxp) {
|
||||
|
||||
if (isc_refcount_decrement(&actx->references) == 1) {
|
||||
isc_refcount_destroy(&actx->references);
|
||||
ISC_LIST_FOREACH_SAFE (actx->named_acl_cache, dacl, nextincache)
|
||||
{
|
||||
ISC_LIST_FOREACH (actx->named_acl_cache, dacl, nextincache) {
|
||||
ISC_LIST_UNLINK(actx->named_acl_cache, dacl,
|
||||
nextincache);
|
||||
dns_acl_detach(&dacl);
|
||||
|
@ -1464,7 +1464,7 @@ check_options(const cfg_obj_t *options, const cfg_obj_t *config,
|
||||
}
|
||||
}
|
||||
|
||||
ISC_LIST_FOREACH_SAFE (list, k, link) {
|
||||
ISC_LIST_FOREACH (list, k, link) {
|
||||
ISC_LIST_UNLINK(list, k, link);
|
||||
dns_kasp_detach(&k);
|
||||
}
|
||||
@ -1492,7 +1492,7 @@ check_options(const cfg_obj_t *options, const cfg_obj_t *config,
|
||||
/*
|
||||
* Cleanup key-store.
|
||||
*/
|
||||
ISC_LIST_FOREACH_SAFE (kslist, ks, link) {
|
||||
ISC_LIST_FOREACH (kslist, ks, link) {
|
||||
ISC_LIST_UNLINK(kslist, ks, link);
|
||||
dns_keystore_detach(&ks);
|
||||
}
|
||||
@ -2973,11 +2973,11 @@ check:
|
||||
if (kasp != NULL) {
|
||||
dns_kasp_detach(&kasp);
|
||||
}
|
||||
ISC_LIST_FOREACH_SAFE (kasplist, k, link) {
|
||||
ISC_LIST_FOREACH (kasplist, k, link) {
|
||||
ISC_LIST_UNLINK(kasplist, k, link);
|
||||
dns_kasp_detach(&k);
|
||||
}
|
||||
ISC_LIST_FOREACH_SAFE (kslist, ks, link) {
|
||||
ISC_LIST_FOREACH (kslist, ks, link) {
|
||||
ISC_LIST_UNLINK(kslist, ks, link);
|
||||
dns_keystore_detach(&ks);
|
||||
}
|
||||
|
@ -1949,7 +1949,7 @@ free_listelt(cfg_parser_t *pctx, cfg_listelt_t *elt) {
|
||||
|
||||
static void
|
||||
free_list(cfg_parser_t *pctx, cfg_obj_t *obj) {
|
||||
ISC_LIST_FOREACH_SAFE (obj->value.list, elt, link) {
|
||||
ISC_LIST_FOREACH (obj->value.list, elt, link) {
|
||||
free_listelt(pctx, elt);
|
||||
}
|
||||
}
|
||||
|
@ -288,7 +288,7 @@ ns_hooktable_free(isc_mem_t *mctx, void **tablep) {
|
||||
*tablep = NULL;
|
||||
|
||||
for (i = 0; i < NS_HOOKPOINTS_COUNT; i++) {
|
||||
ISC_LIST_FOREACH_SAFE ((*table)[i], hook, link) {
|
||||
ISC_LIST_FOREACH ((*table)[i], hook, link) {
|
||||
ISC_LIST_UNLINK((*table)[i], hook, link);
|
||||
if (hook->mctx != NULL) {
|
||||
isc_mem_putanddetach(&hook->mctx, hook,
|
||||
@ -343,7 +343,7 @@ ns_plugins_free(isc_mem_t *mctx, void **listp) {
|
||||
list = *listp;
|
||||
*listp = NULL;
|
||||
|
||||
ISC_LIST_FOREACH_SAFE (*list, plugin, link) {
|
||||
ISC_LIST_FOREACH (*list, plugin, link) {
|
||||
ISC_LIST_UNLINK(*list, plugin, link);
|
||||
unload_plugin(&plugin);
|
||||
}
|
||||
|
@ -818,7 +818,7 @@ purge_old_interfaces(ns_interfacemgr_t *mgr) {
|
||||
ISC_LIST_INIT(interfaces);
|
||||
|
||||
LOCK(&mgr->lock);
|
||||
ISC_LIST_FOREACH_SAFE (mgr->interfaces, ifp, link) {
|
||||
ISC_LIST_FOREACH (mgr->interfaces, ifp, link) {
|
||||
INSIST(NS_INTERFACE_VALID(ifp));
|
||||
if (ifp->generation != mgr->generation) {
|
||||
ISC_LIST_UNLINK(ifp->mgr->interfaces, ifp, link);
|
||||
@ -827,7 +827,7 @@ purge_old_interfaces(ns_interfacemgr_t *mgr) {
|
||||
}
|
||||
UNLOCK(&mgr->lock);
|
||||
|
||||
ISC_LIST_FOREACH_SAFE (interfaces, ifp, link) {
|
||||
ISC_LIST_FOREACH (interfaces, ifp, link) {
|
||||
if (LISTENING(ifp)) {
|
||||
log_interface_shutdown(ifp);
|
||||
ns_interface_shutdown(ifp);
|
||||
@ -920,7 +920,7 @@ clearlistenon(ns_interfacemgr_t *mgr) {
|
||||
ISC_LIST_MOVE(listenon, mgr->listenon);
|
||||
UNLOCK(&mgr->lock);
|
||||
|
||||
ISC_LIST_FOREACH_SAFE (listenon, old, link) {
|
||||
ISC_LIST_FOREACH (listenon, old, link) {
|
||||
ISC_LIST_UNLINK(listenon, old, link);
|
||||
isc_mem_put(mgr->mctx, old, sizeof(*old));
|
||||
}
|
||||
|
@ -297,7 +297,7 @@ ns_listenlist_create(isc_mem_t *mctx, ns_listenlist_t **target) {
|
||||
|
||||
static void
|
||||
destroy(ns_listenlist_t *list) {
|
||||
ISC_LIST_FOREACH_SAFE (list->elts, elt, link) {
|
||||
ISC_LIST_FOREACH (list->elts, elt, link) {
|
||||
ns_listenelt_destroy(elt);
|
||||
}
|
||||
isc_mem_put(list->mctx, list, sizeof(*list));
|
||||
|
@ -732,7 +732,7 @@ static void
|
||||
query_freefreeversions(ns_client_t *client, bool everything) {
|
||||
unsigned int i = 0;
|
||||
|
||||
ISC_LIST_FOREACH_SAFE (client->query.freeversions, dbversion, link) {
|
||||
ISC_LIST_FOREACH (client->query.freeversions, dbversion, link) {
|
||||
/*
|
||||
* If we're not freeing everything, we keep the first three
|
||||
* dbversions structures around.
|
||||
@ -781,7 +781,7 @@ query_reset(ns_client_t *client, bool everything) {
|
||||
/*
|
||||
* Cleanup any active versions.
|
||||
*/
|
||||
ISC_LIST_FOREACH_SAFE (client->query.activeversions, dbversion, link) {
|
||||
ISC_LIST_FOREACH (client->query.activeversions, dbversion, link) {
|
||||
dns_db_closeversion(dbversion->db, &dbversion->version, false);
|
||||
dns_db_detach(&dbversion->db);
|
||||
ISC_LIST_INITANDAPPEND(client->query.freeversions, dbversion,
|
||||
@ -824,7 +824,7 @@ query_reset(ns_client_t *client, bool everything) {
|
||||
|
||||
query_freefreeversions(client, everything);
|
||||
|
||||
ISC_LIST_FOREACH_SAFE (client->query.namebufs, dbuf, link) {
|
||||
ISC_LIST_FOREACH (client->query.namebufs, dbuf, link) {
|
||||
if (ISC_LIST_NEXT(dbuf, link) != NULL || everything) {
|
||||
ISC_LIST_UNLINK(client->query.namebufs, dbuf, link);
|
||||
isc_buffer_free(&dbuf);
|
||||
@ -6024,8 +6024,8 @@ message_clearrdataset(dns_message_t *msg, unsigned int attr) {
|
||||
* Clean up name lists by calling the rdataset disassociate function.
|
||||
*/
|
||||
for (i = DNS_SECTION_ANSWER; i < DNS_SECTION_MAX; i++) {
|
||||
ISC_LIST_FOREACH_SAFE (msg->sections[i], name, link) {
|
||||
ISC_LIST_FOREACH_SAFE (name->list, rds, link) {
|
||||
ISC_LIST_FOREACH (msg->sections[i], name, link) {
|
||||
ISC_LIST_FOREACH (name->list, rds, link) {
|
||||
if ((rds->attributes & attr) != attr) {
|
||||
continue;
|
||||
}
|
||||
|
@ -127,7 +127,7 @@ ns_server_detach(ns_server_t **sctxp) {
|
||||
*sctxp = NULL;
|
||||
|
||||
if (isc_refcount_decrement(&sctx->references) == 1) {
|
||||
ISC_LIST_FOREACH_SAFE (sctx->altsecrets, altsecret, link) {
|
||||
ISC_LIST_FOREACH (sctx->altsecrets, altsecret, link) {
|
||||
ISC_LIST_UNLINK(sctx->altsecrets, altsecret, link);
|
||||
isc_mem_put(sctx->mctx, altsecret, sizeof(*altsecret));
|
||||
}
|
||||
@ -142,7 +142,7 @@ ns_server_detach(ns_server_t **sctxp) {
|
||||
isc_quota_destroy(&sctx->tcpquota);
|
||||
isc_quota_destroy(&sctx->xfroutquota);
|
||||
|
||||
ISC_LIST_FOREACH_SAFE (sctx->http_quotas, http_quota, link) {
|
||||
ISC_LIST_FOREACH (sctx->http_quotas, http_quota, link) {
|
||||
ISC_LIST_DEQUEUE(sctx->http_quotas, http_quota, link);
|
||||
isc_quota_destroy(http_quota);
|
||||
isc_mem_put(sctx->mctx, http_quota,
|
||||
|
@ -484,7 +484,7 @@ static isc_result_t
|
||||
do_diff(dns_diff_t *updates, dns_db_t *db, dns_dbversion_t *ver,
|
||||
dns_diff_t *diff) {
|
||||
isc_result_t result;
|
||||
ISC_LIST_FOREACH_SAFE (updates->tuples, t, link) {
|
||||
ISC_LIST_FOREACH (updates->tuples, t, link) {
|
||||
ISC_LIST_UNLINK(updates->tuples, t, link);
|
||||
CHECK(do_one_tuple(&t, db, ver, diff));
|
||||
}
|
||||
@ -2057,7 +2057,7 @@ remove_orphaned_ds(dns_db_t *db, dns_dbversion_t *newver, dns_diff_t *diff) {
|
||||
result = ISC_R_SUCCESS;
|
||||
|
||||
failure:
|
||||
ISC_LIST_FOREACH_SAFE (temp_diff.tuples, tuple, link) {
|
||||
ISC_LIST_FOREACH (temp_diff.tuples, tuple, link) {
|
||||
ISC_LIST_UNLINK(temp_diff.tuples, tuple, link);
|
||||
dns_diff_appendminimal(diff, &tuple);
|
||||
}
|
||||
@ -2379,7 +2379,7 @@ add_nsec3param_records(ns_client_t *client, dns_zone_t *zone, dns_db_t *db,
|
||||
/*
|
||||
* Extract NSEC3PARAM tuples from list.
|
||||
*/
|
||||
ISC_LIST_FOREACH_SAFE (diff->tuples, tuple, link) {
|
||||
ISC_LIST_FOREACH (diff->tuples, tuple, link) {
|
||||
if (tuple->rdata.type != dns_rdatatype_nsec3param ||
|
||||
!dns_name_equal(name, &tuple->name))
|
||||
{
|
||||
@ -2454,7 +2454,7 @@ add_nsec3param_records(ns_client_t *client, dns_zone_t *zone, dns_db_t *db,
|
||||
* in managing and should not be touched so revert such changes
|
||||
* taking into account any TTL change of the NSEC3PARAM RRset.
|
||||
*/
|
||||
ISC_LIST_FOREACH_SAFE (temp_diff.tuples, tuple, link) {
|
||||
ISC_LIST_FOREACH (temp_diff.tuples, tuple, link) {
|
||||
if ((tuple->rdata.data[1] & ~DNS_NSEC3FLAG_OPTOUT) != 0) {
|
||||
/*
|
||||
* If we haven't had any adds then the tuple->ttl must
|
||||
@ -2645,7 +2645,7 @@ rollback_private(dns_db_t *db, dns_rdatatype_t privatetype,
|
||||
/*
|
||||
* Extract the changes to be rolled back.
|
||||
*/
|
||||
ISC_LIST_FOREACH_SAFE (diff->tuples, tuple, link) {
|
||||
ISC_LIST_FOREACH (diff->tuples, tuple, link) {
|
||||
if (tuple->rdata.type != privatetype ||
|
||||
!dns_name_equal(name, &tuple->name))
|
||||
{
|
||||
@ -2669,7 +2669,7 @@ rollback_private(dns_db_t *db, dns_rdatatype_t privatetype,
|
||||
/*
|
||||
* Rollback the changes.
|
||||
*/
|
||||
ISC_LIST_FOREACH_SAFE (temp_diff.tuples, tuple, link) {
|
||||
ISC_LIST_FOREACH (temp_diff.tuples, tuple, link) {
|
||||
op = (tuple->op == DNS_DIFFOP_DEL) ? DNS_DIFFOP_ADD
|
||||
: DNS_DIFFOP_DEL;
|
||||
dns_difftuple_create(mctx, op, name, tuple->ttl, &tuple->rdata,
|
||||
|
@ -129,7 +129,7 @@ print_rdata(FILE *fp, dns_rdata_t *rdata) {
|
||||
isc_buffer_usedregion(&target, &r);
|
||||
fprintf(fp, "%.*s", (int)r.length, (char *)r.base);
|
||||
|
||||
ISC_LIST_FOREACH_SAFE (rdatalist->rdata, rd, link) {
|
||||
ISC_LIST_FOREACH (rdatalist->rdata, rd, link) {
|
||||
ISC_LIST_UNLINK(rdatalist->rdata, rdata, link);
|
||||
}
|
||||
isc_mem_put(mctx, rdatalist, sizeof(*rdatalist));
|
||||
@ -239,7 +239,7 @@ create_bundle(FILE *fp, isc_stdtime_t btime, int bnum) {
|
||||
sign_rrset(fp, btime, (btime + LIFETIME), dnskeyset,
|
||||
test_bundles[bnum].rrsig1buf,
|
||||
&test_bundles[bnum].dnskey_rrsig);
|
||||
ISC_LIST_FOREACH_SAFE (dnskeylist->rdata, rd, link) {
|
||||
ISC_LIST_FOREACH (dnskeylist->rdata, rd, link) {
|
||||
ISC_LIST_UNLINK(dnskeylist->rdata, rd, link);
|
||||
}
|
||||
isc_mem_put(mctx, dnskeylist, sizeof(*dnskeylist));
|
||||
@ -264,7 +264,7 @@ create_bundle(FILE *fp, isc_stdtime_t btime, int bnum) {
|
||||
sign_rrset(fp, btime, (btime + LIFETIME), cdnskeyset,
|
||||
test_bundles[bnum].rrsig2buf,
|
||||
&test_bundles[bnum].cdnskey_rrsig);
|
||||
ISC_LIST_FOREACH_SAFE (cdnskeylist->rdata, rd, link) {
|
||||
ISC_LIST_FOREACH (cdnskeylist->rdata, rd, link) {
|
||||
ISC_LIST_UNLINK(cdnskeylist->rdata, rd, link);
|
||||
}
|
||||
isc_mem_put(mctx, cdnskeylist, sizeof(*cdnskeylist));
|
||||
@ -287,7 +287,7 @@ create_bundle(FILE *fp, isc_stdtime_t btime, int bnum) {
|
||||
dns_rdata_init(&test_bundles[bnum].cds_rrsig);
|
||||
sign_rrset(fp, btime, (btime + LIFETIME), cdsset,
|
||||
test_bundles[bnum].rrsig3buf, &test_bundles[bnum].cds_rrsig);
|
||||
ISC_LIST_FOREACH_SAFE (cdslist->rdata, rd, link) {
|
||||
ISC_LIST_FOREACH (cdslist->rdata, rd, link) {
|
||||
ISC_LIST_UNLINK(cdslist->rdata, rd, link);
|
||||
}
|
||||
isc_mem_put(mctx, cdslist, sizeof(*cdslist));
|
||||
|
Loading…
x
Reference in New Issue
Block a user