dns_acl_t *acl;
bool exiting;
controlkeylist_t keys;
+ isc_mutex_t connections_lock;
controlconnectionlist_t connections;
isc_socktype_t type;
uint32_t perm;
if (listener->acl != NULL) {
dns_acl_detach(&listener->acl);
}
+ isc_mutex_destroy(&listener->connections_lock);
isc_mem_putanddetach(&listener->mctx, listener, sizeof(*listener));
}
static void
maybe_free_listener(controllistener_t *listener) {
+ LOCK(&listener->connections_lock);
if (listener->exiting && ISC_LIST_EMPTY(listener->connections)) {
+ UNLOCK(&listener->connections_lock);
free_listener(listener);
+ } else {
+ UNLOCK(&listener->connections_lock);
}
}
return;
}
+ LOCK(&listener->connections_lock);
ISC_LIST_UNLINK(listener->connections, conn, link);
+ UNLOCK(&listener->connections_lock);
#ifdef ENABLE_AFL
if (named_g_fuzz_type == isc_fuzz_rndc) {
named_fuzz_notify();
goto cleanup;
}
+ LOCK(&listener->connections_lock);
ISC_LIST_APPEND(listener->connections, conn, link);
+ UNLOCK(&listener->connections_lock);
return (ISC_R_SUCCESS);
cleanup:
.address = *addr,
.type = type };
isc_mem_attach(mctx, &listener->mctx);
+ isc_mutex_init(&listener->connections_lock);
ISC_LINK_INIT(listener, link);
ISC_LIST_INIT(listener->keys);
ISC_LIST_INIT(listener->connections);