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));
}
/* 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);
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);
}
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);
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);
}
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);
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,
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;
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);
}
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));
}
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' */
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);
}
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));
}
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);
}
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));
}
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);
}
/*
* 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);
}
/*
* 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);
}
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));
}
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);
}
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);
}
}
listener->shuttingdown = true;
- ISC_LIST_FOREACH_SAFE (listener->connections, conn, link) {
+ ISC_LIST_FOREACH (listener->connections, conn, link) {
conn_shutdown(conn);
}
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.
*/
/*
* 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,
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);
* 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));
}
}
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));
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)
{
}
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);
}
(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);
*/
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));
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);
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);
}
}
}
- 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);
}
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);
}
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,
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);
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) {
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));
}
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);
/*
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);
*/
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));
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);
/*
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);
* 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);
}
}
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)) {
* 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);
}
} 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);
}
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);
}
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);
}
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);
}
* 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)
/*
* 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;
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",
* 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;
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);
/* 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);
}
}
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);
* 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];
}
/* 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);
}
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);
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));
}
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);
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);
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) {
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;
}
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;
*/
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;
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;
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);
}
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);
* 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);
}
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)
{
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));
}
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);
}
*
* 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);
/*
* 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;
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;
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)) {
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));
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));
}
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);
}
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(),
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++;
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));
}
* 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);
* 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);
}
}
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);
}
}
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);
}
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) {
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));
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,
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);
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);
}
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 {
}
/* 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);
* 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;
* 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);
}
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,
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);
}
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. */
* 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);
}
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,
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);
}
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);
}
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);
}
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);
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);
/*
* 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));
/*
* 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++;
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));
}
/* 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) {
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);
}
/*
* 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);
/*
* 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);
/*
* 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);
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));
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);
}
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;
/*
*/
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,
* 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;
*/
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) {
* 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);
/*
* 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);
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);
}
/*
* 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)) {
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];
* 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));
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);
}
/* 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; \
/* 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; \
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);
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
}
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));
}
#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);
}
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);
}
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;
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
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 */
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);
}
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);
}
}
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);
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);
}
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);
}
}
- ISC_LIST_FOREACH_SAFE (list, k, link) {
+ ISC_LIST_FOREACH (list, k, link) {
ISC_LIST_UNLINK(list, k, link);
dns_kasp_detach(&k);
}
/*
* 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);
}
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);
}
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);
}
}
*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,
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);
}
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);
}
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);
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));
}
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));
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.
/*
* 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,
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);
* 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;
}
*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));
}
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,
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));
}
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);
}
/*
* 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))
{
* 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
/*
* 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))
{
/*
* 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,
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));
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));
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));
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));