Commit 4f74e756 authored by Ondřej Surý's avatar Ondřej Surý

Merge branch 'ondrej/more-conversions-to-isc_refcount-API' into 'master'

Convert more reference counting to isc_refcount API

See merge request !2153
parents 4643ee04 3000f14e
Pipeline #30698 failed with stages
in 78 minutes and 55 seconds
......@@ -75,7 +75,9 @@ static isccc_region_t secret;
static bool failed = false;
static bool c_flag = false;
static isc_mem_t *rndc_mctx;
static isc_refcount_t sends, recvs, connects;
static atomic_uint_fast32_t sends = ATOMIC_VAR_INIT(0);
static atomic_uint_fast32_t recvs = ATOMIC_VAR_INIT(0);
static atomic_uint_fast32_t connects = ATOMIC_VAR_INIT(0);
static char *command;
static char *args;
static char program[256];
......@@ -277,8 +279,8 @@ rndc_senddone(isc_task_t *task, isc_event_t *event) {
fatal("send failed: %s", isc_result_totext(sevent->result));
}
isc_event_free(&event);
if (isc_refcount_decrement(&sends) == 1 &&
isc_refcount_current(&recvs) == 0)
if (atomic_fetch_sub_release(&sends, 1) == 1 &&
atomic_load_acquire(&recvs) == 0)
{
isc_socket_detach(&sock);
isc_task_shutdown(task);
......@@ -295,7 +297,7 @@ rndc_recvdone(isc_task_t *task, isc_event_t *event) {
char *textmsg = NULL;
isc_result_t result;
isc_refcount_decrement(&recvs);
atomic_fetch_sub_release(&recvs, 1);
if (ccmsg.result == ISC_R_EOF)
fatal("connection to remote host closed\n"
......@@ -348,8 +350,8 @@ rndc_recvdone(isc_task_t *task, isc_event_t *event) {
isc_event_free(&event);
isccc_sexpr_free(&response);
if (isc_refcount_current(&sends) == 0
&& isc_refcount_current(&recvs) == 0) {
if (atomic_load_acquire(&sends) == 0
&& atomic_load_acquire(&recvs) == 0) {
isc_socket_detach(&sock);
isc_task_shutdown(task);
isc_app_shutdown();
......@@ -369,7 +371,7 @@ rndc_recvnonce(isc_task_t *task, isc_event_t *event) {
isccc_sexpr_t *data;
isc_buffer_t b;
isc_refcount_decrement(&recvs);
atomic_fetch_sub_release(&recvs, 1);
if (ccmsg.result == ISC_R_EOF)
fatal("connection to remote host closed\n"
......@@ -430,10 +432,10 @@ rndc_recvnonce(isc_task_t *task, isc_event_t *event) {
isccc_ccmsg_cancelread(&ccmsg);
DO("schedule recv", isccc_ccmsg_readmessage(&ccmsg, task,
rndc_recvdone, NULL));
isc_refcount_increment(&recvs);
atomic_fetch_add_relaxed(&recvs, 1);
DO("send message", isc_socket_send(sock, &r, task, rndc_senddone,
NULL));
isc_refcount_increment(&sends);
atomic_fetch_add_relaxed(&sends, 1);
isc_event_free(&event);
isccc_sexpr_free(&response);
......@@ -452,7 +454,7 @@ rndc_connected(isc_task_t *task, isc_event_t *event) {
isc_buffer_t b;
isc_result_t result;
isc_refcount_decrement(&connects);
atomic_fetch_sub_release(&connects, 1);
if (sevent->result != ISC_R_SUCCESS) {
isc_sockaddr_format(&serveraddrs[currentaddr], socktext,
......@@ -498,10 +500,10 @@ rndc_connected(isc_task_t *task, isc_event_t *event) {
DO("schedule recv", isccc_ccmsg_readmessage(&ccmsg, task,
rndc_recvnonce, NULL));
isc_refcount_increment(&recvs);
atomic_fetch_add_relaxed(&recvs, 1);
DO("send message", isc_socket_send(sock, &r, task, rndc_senddone,
NULL));
isc_refcount_increment(&sends);
atomic_fetch_add_relaxed(&sends, 1);
isc_event_free(&event);
isccc_sexpr_free(&request);
}
......@@ -536,7 +538,7 @@ rndc_startconnect(isc_sockaddr_t *addr, isc_task_t *task) {
}
DO("connect", isc_socket_connect(sock, addr, task, rndc_connected,
NULL));
isc_refcount_increment(&connects);
atomic_fetch_add_relaxed(&connects, 1);
}
static void
......@@ -1003,9 +1005,9 @@ main(int argc, char **argv) {
if (result != ISC_R_SUCCESS)
fatal("isc_app_run() failed: %s", isc_result_totext(result));
if (isc_refcount_current(&connects) > 0 ||
isc_refcount_current(&sends) > 0 ||
isc_refcount_current(&recvs) > 0)
if (atomic_load_acquire(&connects) > 0 ||
atomic_load_acquire(&sends) > 0 ||
atomic_load_acquire(&recvs) > 0)
{
isc_socket_cancel(sock, task, ISC_SOCKCANCEL_ALL);
}
......
......@@ -314,8 +314,6 @@ cleanup_filelock:
static void
cache_free(dns_cache_t *cache) {
int i;
REQUIRE(VALID_CACHE(cache));
isc_refcount_destroy(&cache->references);
......@@ -359,10 +357,9 @@ cache_free(dns_cache_t *cache) {
if (strcmp(cache->db_type, "rbt") == 0) {
extra = 1;
}
for (i = extra; i < cache->db_argc; i++) {
for (int i = extra; i < cache->db_argc; i++) {
if (cache->db_argv[i] != NULL) {
isc_mem_free(cache->mctx,
cache->db_argv[i]);
isc_mem_free(cache->mctx, cache->db_argv[i]);
}
}
isc_mem_put(cache->mctx, cache->db_argv,
......
......@@ -598,8 +598,7 @@ deref_portentry(dns_dispatch_t *disp, dispportentry_t **portentryp) {
dns_qid_t *qid;
REQUIRE(disp->port_table != NULL);
REQUIRE(portentry != NULL &&
isc_refcount_current(&portentry->refs) > 0);
REQUIRE(portentry != NULL);
if (isc_refcount_decrement(&portentry->refs) == 1) {
qid = DNS_QID(disp);
......@@ -617,7 +616,6 @@ deref_portentry(dns_dispatch_t *disp, dispportentry_t **portentryp) {
* dispsock->portentry does not change in socket_search.
*/
*portentryp = NULL;
}
/*%
......
......@@ -32,6 +32,7 @@
#include <isc/lang.h>
#include <isc/magic.h>
#include <isc/netaddr.h>
#include <isc/refcount.h>
#include <dns/types.h>
......@@ -47,7 +48,7 @@
struct dns_peerlist {
unsigned int magic;
uint32_t refs;
isc_refcount_t refs;
isc_mem_t *mem;
......@@ -56,7 +57,7 @@ struct dns_peerlist {
struct dns_peer {
unsigned int magic;
uint32_t refs;
isc_refcount_t refs;
isc_mem_t *mem;
......
......@@ -440,16 +440,6 @@ dns_resolver_setlamettl(dns_resolver_t *resolver, uint32_t lame_ttl);
*\li 'resolver' to be valid.
*/
unsigned int
dns_resolver_nrunning(dns_resolver_t *resolver);
/*%<
* Return the number of currently running resolutions in this
* resolver. This is may be less than the number of outstanding
* fetches due to multiple identical fetches, or more than the
* number of of outstanding fetches due to the fact that resolution
* can continue even though a fetch has been canceled.
*/
isc_result_t
dns_resolver_addalternate(dns_resolver_t *resolver, const isc_sockaddr_t *alt,
const dns_name_t *name, in_port_t port);
......
......@@ -40,7 +40,7 @@ struct dns_keytable {
/* Unlocked. */
unsigned int magic;
isc_mem_t *mctx;
isc_refcount_t active_nodes;
atomic_uint_fast32_t active_nodes;
isc_refcount_t references;
isc_rwlock_t rwlock;
/* Locked by rwlock. */
......@@ -90,7 +90,7 @@ dns_keytable_create(isc_mem_t *mctx, dns_keytable_t **keytablep) {
goto cleanup_rbt;
}
isc_refcount_init(&keytable->active_nodes, 0);
atomic_init(&keytable->active_nodes, 0);
isc_refcount_init(&keytable->references, 1);
keytable->mctx = NULL;
......@@ -132,7 +132,7 @@ dns_keytable_detach(dns_keytable_t **keytablep) {
if (isc_refcount_decrement(&keytable->references) == 1) {
isc_refcount_destroy(&keytable->references);
isc_refcount_destroy(&keytable->active_nodes);
REQUIRE(atomic_load_acquire(&keytable->active_nodes) == 0);
dns_rbt_destroy(&keytable->table);
isc_rwlock_destroy(&keytable->rwlock);
keytable->magic = 0;
......@@ -481,12 +481,14 @@ dns_keytable_find(dns_keytable_t *keytable, const dns_name_t *keyname,
DNS_RBTFIND_NOOPTIONS, NULL, NULL);
if (result == ISC_R_SUCCESS) {
if (node->data != NULL) {
isc_refcount_increment0(&keytable->active_nodes);
dns_keynode_attach(node->data, keynodep);
} else
dns_keytable_attachkeynode(keytable, node->data,
keynodep);
} else {
result = ISC_R_NOTFOUND;
} else if (result == DNS_R_PARTIALMATCH)
}
} else if (result == DNS_R_PARTIALMATCH) {
result = ISC_R_NOTFOUND;
}
RWUNLOCK(&keytable->rwlock, isc_rwlocktype_read);
return (result);
......@@ -509,8 +511,7 @@ dns_keytable_nextkeynode(dns_keytable_t *keytable, dns_keynode_t *keynode,
return (ISC_R_NOTFOUND);
}
dns_keynode_attach(keynode->next, nextnodep);
isc_refcount_increment(&keytable->active_nodes);
dns_keytable_attachkeynode(keytable, keynode->next, nextnodep);
return (ISC_R_SUCCESS);
}
......@@ -560,8 +561,7 @@ dns_keytable_findkeynode(dns_keytable_t *keytable, const dns_name_t *name,
}
}
if (knode != NULL) {
isc_refcount_increment0(&keytable->active_nodes);
dns_keynode_attach(knode, keynodep);
dns_keytable_attachkeynode(keytable, knode, keynodep);
} else {
result = DNS_R_PARTIALMATCH;
}
......@@ -602,9 +602,8 @@ dns_keytable_findnextkeynode(dns_keytable_t *keytable, dns_keynode_t *keynode,
}
}
if (knode != NULL) {
isc_refcount_increment(&keytable->active_nodes);
dns_keytable_attachkeynode(keytable, knode, nextnodep);
result = ISC_R_SUCCESS;
dns_keynode_attach(knode, nextnodep);
} else {
result = ISC_R_NOTFOUND;
}
......@@ -653,7 +652,7 @@ dns_keytable_attachkeynode(dns_keytable_t *keytable, dns_keynode_t *source,
REQUIRE(VALID_KEYNODE(source));
REQUIRE(target != NULL && *target == NULL);
isc_refcount_increment(&keytable->active_nodes);
REQUIRE(atomic_fetch_add_relaxed(&keytable->active_nodes, 1) < UINT32_MAX);
dns_keynode_attach(source, target);
}
......@@ -668,7 +667,8 @@ dns_keytable_detachkeynode(dns_keytable_t *keytable, dns_keynode_t **keynodep)
REQUIRE(VALID_KEYTABLE(keytable));
REQUIRE(keynodep != NULL && VALID_KEYNODE(*keynodep));
INSIST(isc_refcount_decrement(&keytable->active_nodes) > 0);
REQUIRE(atomic_fetch_sub_release(&keytable->active_nodes, 1) > 0);
dns_keynode_detach(keytable->mctx, keynodep);
}
......@@ -891,7 +891,8 @@ dns_keytable_forall(dns_keytable_t *keytable,
}
goto cleanup;
}
isc_refcount_increment0(&keytable->active_nodes);
REQUIRE(atomic_fetch_add_relaxed(&keytable->active_nodes, 1)
< UINT32_MAX);
for (;;) {
dns_rbtnodechain_current(&chain, foundname, origin, &node);
if (node->data != NULL) {
......@@ -908,7 +909,7 @@ dns_keytable_forall(dns_keytable_t *keytable,
break;
}
}
INSIST(isc_refcount_decrement(&keytable->active_nodes) > 0);
REQUIRE(atomic_fetch_sub_release(&keytable->active_nodes, 1) > 0);
cleanup:
dns_rbtnodechain_invalidate(&chain);
......
......@@ -91,7 +91,7 @@ dns_lib_init(void) {
if (!initialize_done)
return (ISC_R_FAILURE);
isc_refcount_increment(&references);
isc_refcount_increment0(&references);
return (ISC_R_SUCCESS);
}
......
......@@ -431,16 +431,17 @@ incctx_destroy(isc_mem_t *mctx, dns_incctx_t *ictx) {
static void
loadctx_destroy(dns_loadctx_t *lctx) {
isc_result_t result;
REQUIRE(DNS_LCTX_VALID(lctx));
isc_refcount_destroy(&lctx->references);
lctx->magic = 0;
if (lctx->inc != NULL)
if (lctx->inc != NULL) {
incctx_destroy(lctx->mctx, lctx->inc);
}
if (lctx->f != NULL) {
result = isc_stdio_close(lctx->f);
isc_result_t result = isc_stdio_close(lctx->f);
if (result != ISC_R_SUCCESS) {
UNEXPECTED_ERROR(__FILE__, __LINE__,
"isc_stdio_close() failed: %s",
......@@ -449,8 +450,9 @@ loadctx_destroy(dns_loadctx_t *lctx) {
}
/* isc_lex_destroy() will close all open streams */
if (lctx->lex != NULL && !lctx->keep_lex)
if (lctx->lex != NULL && !lctx->keep_lex) {
isc_lex_destroy(&lctx->lex);
}
if (lctx->task != NULL) {
isc_task_detach(&lctx->task);
......
......@@ -234,7 +234,7 @@ struct dns_dumpctx {
unsigned int nodes;
/* dns_master_dumpinc() */
char *file;
char *tmpfile;
char *tmpfile;
dns_masterformat_t format;
dns_masterrawheader_t header;
isc_result_t (*dumpsets)(isc_mem_t *mctx,
......
......@@ -62,7 +62,7 @@ dns_peerlist_new(isc_mem_t *mem, dns_peerlist_t **list) {
ISC_LIST_INIT(l->elements);
l->mem = mem;
l->refs = 1;
isc_refcount_init(&l->refs, 1);
l->magic = DNS_PEERLIST_MAGIC;
*list = l;
......@@ -76,9 +76,7 @@ dns_peerlist_attach(dns_peerlist_t *source, dns_peerlist_t **target) {
REQUIRE(target != NULL);
REQUIRE(*target == NULL);
source->refs++;
ENSURE(source->refs != 0xffffffffU);
isc_refcount_increment(&source->refs);
*target = source;
}
......@@ -94,12 +92,9 @@ dns_peerlist_detach(dns_peerlist_t **list) {
plist = *list;
*list = NULL;
REQUIRE(plist->refs > 0);
plist->refs--;
if (plist->refs == 0)
if (isc_refcount_decrement(&plist->refs) == 1) {
peerlist_delete(&plist);
}
}
static void
......@@ -112,7 +107,7 @@ peerlist_delete(dns_peerlist_t **list) {
l = *list;
REQUIRE(l->refs == 0);
isc_refcount_destroy(&l->refs);
server = ISC_LIST_HEAD(l->elements);
while (server != NULL) {
......@@ -218,26 +213,19 @@ dns_peer_newprefix(isc_mem_t *mem, const isc_netaddr_t *addr,
{
dns_peer_t *peer;
REQUIRE(peerptr != NULL);
REQUIRE(peerptr != NULL && *peerptr == NULL);
peer = isc_mem_get(mem, sizeof(*peer));
peer->magic = DNS_PEER_MAGIC;
peer->address = *addr;
peer->prefixlen = prefixlen;
peer->mem = mem;
peer->bogus = false;
peer->transfer_format = dns_one_answer;
peer->transfers = 0;
peer->request_ixfr = false;
peer->provide_ixfr = false;
peer->key = NULL;
peer->refs = 1;
peer->transfer_source = NULL;
peer->notify_source = NULL;
peer->query_source = NULL;
memset(&peer->bitflags, 0x0, sizeof(peer->bitflags));
*peer = (dns_peer_t){
.magic = DNS_PEER_MAGIC,
.address = *addr,
.prefixlen = prefixlen,
.mem = mem,
.transfer_format = dns_one_answer,
};
isc_refcount_init(&peer->refs, 1);
ISC_LINK_INIT(peer, next);
......@@ -252,9 +240,7 @@ dns_peer_attach(dns_peer_t *source, dns_peer_t **target) {
REQUIRE(target != NULL);
REQUIRE(*target == NULL);
source->refs++;
ENSURE(source->refs != 0xffffffffU);
isc_refcount_increment(&source->refs);
*target = source;
}
......@@ -268,14 +254,11 @@ dns_peer_detach(dns_peer_t **peer) {
REQUIRE(DNS_PEER_VALID(*peer));
p = *peer;
REQUIRE(p->refs > 0);
*peer = NULL;
p->refs--;
if (p->refs == 0)
if (isc_refcount_decrement(&p->refs) == 1) {
peer_delete(&p);
}
}
static void
......@@ -288,7 +271,7 @@ peer_delete(dns_peer_t **peer) {
p = *peer;
REQUIRE(p->refs == 0);
isc_refcount_destroy(&p->refs);
mem = p->mem;
p->mem = NULL;
......
......@@ -1818,7 +1818,7 @@ delete_node(dns_rbtdb_t *rbtdb, dns_rbtnode_t *node) {
static inline void
new_reference(dns_rbtdb_t *rbtdb, dns_rbtnode_t *node) {
INSIST(!ISC_LINK_LINKED(node, deadlink));
if (isc_refcount_increment(&node->references) == 0) {
if (isc_refcount_increment0(&node->references) == 0) {
/* this is the first reference to the node */
isc_refcount_increment0(&rbtdb->node_locks[node->locknum].references);
}
......@@ -8322,7 +8322,7 @@ dns_rbtdb_create(isc_mem_t *mctx, const dns_name_t *origin, dns_dbtype_t type,
rbtdb->next_serial = 2;
rbtdb->current_version = allocate_version(mctx, 1, 1, false);
if (rbtdb->current_version == NULL) {
INSIST(isc_refcount_decrement(&rbtdb->references) > 0);
isc_refcount_decrement(&rbtdb->references);
free_rbtdb(rbtdb, false, NULL);
return (ISC_R_NOMEMORY);
}
......@@ -8343,7 +8343,7 @@ dns_rbtdb_create(isc_mem_t *mctx, const dns_name_t *origin, dns_dbtype_t type,
isc_mem_put(mctx, rbtdb->current_version,
sizeof(*rbtdb->current_version));
rbtdb->current_version = NULL;
INSIST(isc_refcount_decrement(&rbtdb->references) > 0);
isc_refcount_decrement(&rbtdb->references);
free_rbtdb(rbtdb, false, NULL);
return (result);
}
......
......@@ -539,7 +539,7 @@ struct dns_resolver {
dns_fetch_t * primefetch;
/* Atomic. */
isc_refcount_t nfctx;
atomic_uint_fast32_t nfctx;
};
#define RES_MAGIC ISC_MAGIC('R', 'e', 's', '!')
......@@ -4322,7 +4322,7 @@ fctx_unlink(fetchctx_t *fctx) {
ISC_LIST_UNLINK(res->buckets[bucketnum].fctxs, fctx, link);
isc_refcount_decrement(&res->nfctx);
REQUIRE(atomic_fetch_sub_release(&res->nfctx, 1) > 0);
dec_stats(res, dns_resstatscounter_nfetch);
......@@ -4650,7 +4650,7 @@ fctx_start(isc_task_t *task, isc_event_t *event) {
else
fctx_try(fctx, false, false);
} else if (dodestroy) {
fctx_destroy(fctx);
fctx_destroy(fctx);
if (bucket_empty)
empty_bucket(res);
}
......@@ -5015,7 +5015,7 @@ fctx_create(dns_resolver_t *res, const dns_name_t *name, dns_rdatatype_t type,
ISC_LIST_APPEND(res->buckets[bucketnum].fctxs, fctx, link);
isc_refcount_increment(&res->nfctx);
REQUIRE(atomic_fetch_add_relaxed(&res->nfctx, 1) < UINT32_MAX);
inc_stats(res, dns_resstatscounter_nfetch);
......@@ -6986,7 +6986,7 @@ static void
fctx_increference(fetchctx_t *fctx) {
REQUIRE(VALID_FCTX(fctx));
isc_refcount_increment(&fctx->references);
isc_refcount_increment0(&fctx->references);
}
/*
......@@ -9799,7 +9799,7 @@ destroy(dns_resolver_t *res) {
RTRACE("destroy");
isc_refcount_destroy(&res->nfctx);
REQUIRE(atomic_load_acquire(&res->nfctx) == 0);
isc_mutex_destroy(&res->primelock);
isc_mutex_destroy(&res->lock);
......@@ -10045,7 +10045,7 @@ dns_resolver_create(dns_view_t *view,
res->priming = false;
res->primefetch = NULL;
isc_refcount_init(&res->nfctx, 0);
atomic_init(&res->nfctx, 0);
isc_mutex_init(&res->lock);
isc_mutex_init(&res->primelock);
......@@ -10805,11 +10805,6 @@ dns_resolver_setlamettl(dns_resolver_t *resolver, uint32_t lame_ttl) {
resolver->lame_ttl = lame_ttl;
}
unsigned int
dns_resolver_nrunning(dns_resolver_t *resolver) {
return (isc_refcount_current(&resolver->nfctx));
}
isc_result_t
dns_resolver_addalternate(dns_resolver_t *resolver, const isc_sockaddr_t *alt,
const dns_name_t *name, in_port_t port) {
......
......@@ -1484,9 +1484,9 @@ cleanup_task:
dns_rbt_destroy(&zones->rbt);
cleanup_rbt:
INSIST(isc_refcount_decrement(&zones->irefs) == 1);
isc_refcount_decrement(&zones->irefs);
isc_refcount_destroy(&zones->irefs);
INSIST(isc_refcount_decrement(&zones->refs) == 1);
isc_refcount_decrement(&zones->refs);
isc_refcount_destroy(&zones->refs);
isc_mutex_destroy(&zones->maint_lock);
......@@ -1567,7 +1567,7 @@ cleanup_ht:
isc_timer_detach(&zone->updatetimer);
cleanup_timer:
INSIST(isc_refcount_decrement(&zone->refs) > 0);
isc_refcount_decrement(&zone->refs);
isc_refcount_destroy(&zone->refs);
isc_mem_put(rpzs->mctx, zone, sizeof(*zone));
......
......@@ -517,6 +517,8 @@ static void
destroy(dns_sdb_t *sdb) {
dns_sdbimplementation_t *imp = sdb->implementation;
isc_refcount_destroy(&sdb->references);
if (imp->methods->destroy != NULL) {
MAYBE_LOCK(sdb);
imp->methods->destroy(sdb->zone, imp->driverdata,
......
......@@ -480,6 +480,8 @@ destroynode(dns_sdlznode_t *node) {
dns_db_t *db;
isc_mem_t *mctx;
isc_refcount_destroy(&node->references);
sdlz = node->sdlz;
mctx = sdlz->common.mctx;
......@@ -504,7 +506,6 @@ destroynode(dns_sdlznode_t *node) {
dns_name_free(node->name, mctx);
isc_mem_put(mctx, node->name, sizeof(dns_name_t));
}
isc_refcount_destroy(&node->references);
node->magic = 0;
isc_mem_put(mctx, node, sizeof(dns_sdlznode_t));
......
......@@ -125,6 +125,7 @@ dns_stats_detach(dns_stats_t **statsp) {
*statsp = NULL;
if (isc_refcount_decrement(&stats->references) == 1) {
isc_refcount_destroy(&stats->references);
isc_stats_detach(&stats->counters);
isc_mem_putanddetach(&stats->mctx, stats, sizeof(*stats));
}
......
......@@ -215,7 +215,7 @@ static dns_dispatch_t *dispatch = NULL;
static dns_dispentry_t *dispentry = NULL;
static atomic_bool first = ATOMIC_VAR_INIT(true);
static isc_sockaddr_t local;
static isc_refcount_t responses;
static atomic_uint_fast32_t responses;
static void
response(isc_task_t *task, isc_event_t *event) {
......@@ -224,7 +224,7 @@ response(isc_task_t *task, isc_event_t *event) {
UNUSED(task);
isc_refcount_increment(&responses);
atomic_fetch_add_relaxed(&responses, 1);
if (atomic_compare_exchange_strong(&first, &exp_true, false)) {
isc_result_t result = dns_dispatch_getnext(dispentry, &devent);
assert_int_equal(result, ISC_R_SUCCESS);
......@@ -261,7 +261,7 @@ dispatch_getnext(void **state) {
<