dst_key_free(&key);
}
- } while (conflict == true);
+ } while (conflict);
if (conflict) {
fatal("cannot generate a null key due to possible key ID "
result = dns_zt_find(ev->view->zonetable,
dns_catz_entry_getname(ev->entry), 0, NULL, &zone);
- if (ev->mod == true) {
+ if (ev->mod) {
if (result != ISC_R_SUCCESS) {
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_SERVER, ISC_LOG_WARNING,
return (ISC_R_FAILURE);
}
- if (create_allowed == true) {
+ if (create_allowed) {
createFlag = DB_CREATE;
}
/* open the database. */
data_type = 'b';
}
} else if (data_type == 'c' || data_type == 'C') {
- if (have_czone == true) {
+ if (have_czone) {
isc_buffer_putstr(
&buf2, token.value.as_pointer);
/* add string terminator to buffer */
}
/* open BDB environment */
- if (create_allowed == true) {
+ if (create_allowed) {
/* allowed to create new files */
bdbres = db.dbenv->open(db.dbenv, db_envdir,
DB_INIT_CDB | DB_INIT_MPOOL | DB_CREATE,
int curIndex = 0;
/* verify that only allowed parameters were passed. */
- if (dlt == true) {
+ if (dlt) {
checkInvalidParam(zone, "z", "for delete operation");
checkInvalidParam(host, "h", "for delete operation");
checkInvalidOption(list_everything, true, "e",
memset(&bdbdata, 0, sizeof(bdbdata));
/* Dump database in "dlzbdb" bulk format */
- if (list_everything == true) {
+ if (list_everything) {
if (bulk_write('c', db.client, db.cursor, &bdbkey, &bdbdata) !=
ISC_R_SUCCESS) {
return;
bdbkey.data = &recno;
bdbkey.size = sizeof(recno);
- if (dlt == true) {
+ if (dlt) {
bdbres = db.data->del(db.data, NULL, &bdbkey, 0);
} else {
bdbdata.flags = DB_DBT_REALLOC;
/* if client_zone was passed */
if (c_zone != NULL) {
/* create a cursor and make sure it worked. */
- if (dlt == true) {
+ if (dlt) {
/* open read-write cursor */
bdbres = db.client->cursor(db.client, NULL, &db.cursor,
DB_WRITECURSOR);
* was really a query segment, and not a pointer to
* %zone%, or %record%, or %client%
*/
- if (tseg->sql != NULL && tseg->direct == true) {
+ if (tseg->sql != NULL && tseg->direct) {
isc_mem_free(mctx, tseg->sql);
}
/* get the next query segment, before we destroy this one. */
* if this is a query segment, use the
* precalculated string length
*/
- if (tseg->direct == true) {
+ if (tseg->direct) {
length += tseg->strlen;
} else { /* calculate string length for dynamic segments. */
length += strlen(*(char **)tseg->sql);
/* start at the top of the list again */
tseg = ISC_LIST_HEAD(*querylist);
while (tseg != NULL) {
- if (tseg->direct == true) {
+ if (tseg->direct) {
/* query segments */
strcat(qs, tseg->sql);
} else {
* was really a query segment, and not a pointer to
* %zone%, or %record%, or %client%
*/
- if (tseg->cmd != NULL && tseg->direct == true) {
+ if (tseg->cmd != NULL && tseg->direct) {
free(tseg->cmd);
}
/* get the next query segment, before we destroy this one. */
* if this is a query segment, use the
* precalculated string length
*/
- if (tseg->direct == true) {
+ if (tseg->direct) {
length += tseg->strlen;
} else { /* calculate string length for dynamic segments. */
length += strlen(*(char **)tseg->cmd);
/* start at the top of the list again */
tseg = DLZ_LIST_HEAD(*querylist);
while (tseg != NULL) {
- if (tseg->direct == true) {
+ if (tseg->direct) {
/* query segments */
strcat(qs, tseg->cmd);
} else {
}
zone->magic = 0;
isc_timer_detach(&zone->updatetimer);
- if (zone->db_registered == true) {
+ if (zone->db_registered) {
INSIST(dns_db_updatenotify_unregister(
zone->db, dns_catz_dbupdate_callback,
zone->catzs) == ISC_R_SUCCESS);
unsigned char *p;
REQUIRE(VALID_CCTX(cctx));
- REQUIRE(dns_name_isabsolute(name) == true);
+ REQUIRE(dns_name_isabsolute(name));
REQUIRE(offset != NULL);
if (ISC_UNLIKELY((cctx->allowed & DNS_COMPRESS_ENABLED) == 0)) {
(db->methods->closeversion)(db, versionp, commit);
- if (commit == true) {
+ if (commit) {
for (listener = ISC_LIST_HEAD(db->update_listeners);
listener != NULL; listener = ISC_LIST_NEXT(listener, link))
{
isc_result_t
dns_db_getoriginnode(dns_db_t *db, dns_dbnode_t **nodep) {
REQUIRE(DNS_DB_VALID(db));
- REQUIRE(dns_db_iszone(db) == true);
+ REQUIRE(dns_db_iszone(db));
REQUIRE(nodep != NULL && *nodep == NULL);
if (db->methods->getoriginnode != NULL) {
uint16_t *iterations, unsigned char *salt,
size_t *salt_length) {
REQUIRE(DNS_DB_VALID(db));
- REQUIRE(dns_db_iszone(db) == true);
+ REQUIRE(dns_db_iszone(db));
if (db->methods->getnsec3parameters != NULL) {
return ((db->methods->getnsec3parameters)(db, version, hash,
dns_db_getsize(dns_db_t *db, dns_dbversion_t *version, uint64_t *records,
uint64_t *bytes) {
REQUIRE(DNS_DB_VALID(db));
- REQUIRE(dns_db_iszone(db) == true);
+ REQUIRE(dns_db_iszone(db));
if (db->methods->getsize != NULL) {
return ((db->methods->getsize)(db, version, records, bytes));
LOCK(&disp->lock);
- REQUIRE(resp->item_out == true);
+ REQUIRE(resp->item_out);
resp->item_out = false;
if (ev->buffer.base != NULL) {
}
if (ev != NULL) {
- REQUIRE(res->item_out == true);
+ REQUIRE(res->item_out);
res->item_out = false;
if (ev->buffer.base != NULL) {
free_buffer(disp, ev->buffer.base, ev->buffer.length);
void
dst_lib_destroy(void) {
int i;
- RUNTIME_CHECK(dst_initialized == true);
+ RUNTIME_CHECK(dst_initialized);
dst_initialized = false;
for (i = 0; i < DST_MAX_ALGS; i++) {
bool
dst_algorithm_supported(unsigned int alg) {
- REQUIRE(dst_initialized == true);
+ REQUIRE(dst_initialized);
if (alg >= DST_MAX_ALGS || dst_t_func[alg] == NULL) {
return (false);
dst_context_t *dctx;
isc_result_t result;
- REQUIRE(dst_initialized == true);
+ REQUIRE(dst_initialized);
REQUIRE(VALID_KEY(key));
REQUIRE(mctx != NULL);
REQUIRE(dctxp != NULL && *dctxp == NULL);
isc_result_t
dst_key_computesecret(const dst_key_t *pub, const dst_key_t *priv,
isc_buffer_t *secret) {
- REQUIRE(dst_initialized == true);
+ REQUIRE(dst_initialized);
REQUIRE(VALID_KEY(pub) && VALID_KEY(priv));
REQUIRE(secret != NULL);
dst_key_tofile(const dst_key_t *key, int type, const char *directory) {
isc_result_t ret = ISC_R_SUCCESS;
- REQUIRE(dst_initialized == true);
+ REQUIRE(dst_initialized);
REQUIRE(VALID_KEY(key));
REQUIRE((type &
(DST_TYPE_PRIVATE | DST_TYPE_PUBLIC | DST_TYPE_STATE)) != 0);
isc_buffer_t *buf) {
isc_result_t result;
- REQUIRE(dst_initialized == true);
+ REQUIRE(dst_initialized);
REQUIRE(dns_name_isabsolute(name));
REQUIRE((type &
(DST_TYPE_PRIVATE | DST_TYPE_PUBLIC | DST_TYPE_STATE)) != 0);
isc_buffer_t buf;
dst_key_t *key;
- REQUIRE(dst_initialized == true);
+ REQUIRE(dst_initialized);
REQUIRE(dns_name_isabsolute(name));
REQUIRE((type & (DST_TYPE_PRIVATE | DST_TYPE_PUBLIC)) != 0);
REQUIRE(mctx != NULL);
int newfilenamelen = 0;
isc_lex_t *lex = NULL;
- REQUIRE(dst_initialized == true);
+ REQUIRE(dst_initialized);
REQUIRE(filename != NULL);
REQUIRE((type & (DST_TYPE_PRIVATE | DST_TYPE_PUBLIC)) != 0);
REQUIRE(mctx != NULL);
isc_result_t
dst_key_todns(const dst_key_t *key, isc_buffer_t *target) {
- REQUIRE(dst_initialized == true);
+ REQUIRE(dst_initialized);
REQUIRE(VALID_KEY(key));
REQUIRE(target != NULL);
isc_result_t
dst_key_tobuffer(const dst_key_t *key, isc_buffer_t *target) {
- REQUIRE(dst_initialized == true);
+ REQUIRE(dst_initialized);
REQUIRE(VALID_KEY(key));
REQUIRE(target != NULL);
isc_lex_t *lex = NULL;
isc_result_t result = ISC_R_SUCCESS;
- REQUIRE(dst_initialized == true);
+ REQUIRE(dst_initialized);
REQUIRE(VALID_KEY(key));
REQUIRE(!dst_key_isprivate(key));
REQUIRE(buffer != NULL);
dst_key_t *key;
isc_result_t result;
- REQUIRE(dst_initialized == true);
+ REQUIRE(dst_initialized);
REQUIRE(dns_name_isabsolute(name));
REQUIRE(mctx != NULL);
REQUIRE(keyp != NULL && *keyp == NULL);
dst_key_t *key;
isc_result_t result;
- REQUIRE(dst_initialized == true);
+ REQUIRE(dst_initialized);
REQUIRE(dns_name_isabsolute(name));
REQUIRE(mctx != NULL);
REQUIRE(keyp != NULL && *keyp == NULL);
dst_key_t *key;
isc_result_t ret;
- REQUIRE(dst_initialized == true);
+ REQUIRE(dst_initialized);
REQUIRE(dns_name_isabsolute(name));
REQUIRE(mctx != NULL);
REQUIRE(keyp != NULL && *keyp == NULL);
comparekeys(const dst_key_t *key1, const dst_key_t *key2,
bool match_revoked_key,
bool (*compare)(const dst_key_t *key1, const dst_key_t *key2)) {
- REQUIRE(dst_initialized == true);
+ REQUIRE(dst_initialized);
REQUIRE(VALID_KEY(key1));
REQUIRE(VALID_KEY(key2));
bool
dst_key_paramcompare(const dst_key_t *key1, const dst_key_t *key2) {
- REQUIRE(dst_initialized == true);
+ REQUIRE(dst_initialized);
REQUIRE(VALID_KEY(key1));
REQUIRE(VALID_KEY(key2));
}
if (key1->key_alg == key2->key_alg &&
key1->func->paramcompare != NULL &&
- key1->func->paramcompare(key1, key2) == true)
+ key1->func->paramcompare(key1, key2))
{
return (true);
} else {
void
dst_key_attach(dst_key_t *source, dst_key_t **target) {
- REQUIRE(dst_initialized == true);
+ REQUIRE(dst_initialized);
REQUIRE(target != NULL && *target == NULL);
REQUIRE(VALID_KEY(source));
void
dst_key_free(dst_key_t **keyp) {
- REQUIRE(dst_initialized == true);
+ REQUIRE(dst_initialized);
REQUIRE(keyp != NULL && VALID_KEY(*keyp));
dst_key_t *key = *keyp;
*keyp = NULL;
isc_result_t
dst_key_sigsize(const dst_key_t *key, unsigned int *n) {
- REQUIRE(dst_initialized == true);
+ REQUIRE(dst_initialized);
REQUIRE(VALID_KEY(key));
REQUIRE(n != NULL);
isc_result_t
dst_key_secretsize(const dst_key_t *key, unsigned int *n) {
- REQUIRE(dst_initialized == true);
+ REQUIRE(dst_initialized);
REQUIRE(VALID_KEY(key));
REQUIRE(n != NULL);
isc_result_t result;
dst_key_t *key;
- REQUIRE(dst_initialized == true);
+ REQUIRE(dst_initialized);
REQUIRE(keyp != NULL && *keyp == NULL);
if (alg >= DST_MAX_ALGS || dst_t_func[alg] == NULL) {
static bool
issymmetric(const dst_key_t *key) {
- REQUIRE(dst_initialized == true);
+ REQUIRE(dst_initialized);
REQUIRE(VALID_KEY(key));
/* XXXVIX this switch statement is too sparse to gen a jump table. */
static isc_result_t
algorithm_status(unsigned int alg) {
- REQUIRE(dst_initialized == true);
+ REQUIRE(dst_initialized);
if (dst_algorithm_supported(alg)) {
return (ISC_R_SUCCESS);
}
UNLOCK(&dyndb_lock);
- if (exiting == true) {
+ if (exiting) {
isc_mutex_destroy(&dyndb_lock);
}
}
dst_key_free(&newkey);
}
}
- } while (conflict == true);
+ } while (conflict);
INSIST(!conflict);
dst_key_setnum(newkey, DST_NUM_LIFETIME, dns_kasp_key_lifetime(kkey));
if (ret == ISC_R_UNEXPECTEDEND && ignore_tc) {
return (DNS_R_RECOVERABLE);
}
- if (seen_problem == true) {
+ if (seen_problem) {
return (DNS_R_RECOVERABLE);
}
return (ISC_R_SUCCESS);
unsigned int length;
bool unknown;
- REQUIRE(origin == NULL || dns_name_isabsolute(origin) == true);
+ REQUIRE(origin == NULL || dns_name_isabsolute(origin));
if (rdata != NULL) {
REQUIRE(DNS_RDATA_INITIALIZED(rdata));
REQUIRE(DNS_RDATA_VALIDFLAGS(rdata));
unsigned int cur;
REQUIRE(rdata != NULL);
- REQUIRE(tctx->origin == NULL ||
- dns_name_isabsolute(tctx->origin) == true);
+ REQUIRE(tctx->origin == NULL || dns_name_isabsolute(tctx->origin));
/*
* Some DynDNS meta-RRs have empty rdata.
REQUIRE(n + 1 <= source->length);
if (n == 0U) {
- REQUIRE(quote == true);
+ REQUIRE(quote);
}
if (quote) {
/*
* If there's an update pending, schedule it.
*/
- if (rpz->updatepending == true) {
+ if (rpz->updatepending) {
if (rpz->min_update_interval > 0) {
uint64_t defer = rpz->min_update_interval;
char dname[DNS_NAME_FORMATSIZE];
RETERR(dns_rdata_tostruct(&rtkeyrdata, &rtkey, NULL));
freertkey = true;
- if (win2k == true) {
+ if (win2k) {
RETERR(find_tkey(qmsg, &tkeyname, &qtkeyrdata,
DNS_SECTION_ANSWER));
} else {
REQUIRE(main_thread == GetCurrentThread());
#endif /* ifdef WIN32 */
- if (atomic_compare_exchange_strong_acq_rel(
- &ctx->running, &(bool){ false }, true) == true)
+ if (atomic_compare_exchange_strong_acq_rel(&ctx->running,
+ &(bool){ false }, true))
{
/*
* Post any on-run events (in FIFO order).
isc_app_run(void) {
isc_result_t result;
- REQUIRE(atomic_compare_exchange_strong_acq_rel(
- &is_running, &(bool){ false }, true) == true);
+ REQUIRE(atomic_compare_exchange_strong_acq_rel(&is_running,
+ &(bool){ false }, true));
result = isc_app_ctxrun(&isc_g_appctx);
atomic_store_release(&is_running, false);
isc_httpd_addheader(httpd, "Server: libisc", NULL);
- if (is_compressed == true) {
+ if (is_compressed) {
isc_httpd_addheader(httpd, "Content-Encoding", "deflate");
isc_httpd_addheaderuint(
httpd, "Content-Length",
LOCK(&mgr->lock);
bool success = atomic_compare_exchange_strong(&mgr->interlocked,
&(bool){ true }, false);
- INSIST(success == true);
+ INSIST(success);
BROADCAST(&mgr->wkstatecond);
UNLOCK(&mgr->lock);
}
isc__taskmgr_resume(isc_taskmgr_t *manager0);
#define DEFAULT_DEFAULT_QUANTUM 25
-#define FINISHED(m) \
- (atomic_load_relaxed(&((m)->exiting)) == true && \
+#define FINISHED(m) \
+ (atomic_load_relaxed(&((m)->exiting)) && \
atomic_load(&(m)->tasks_count) == 0)
/*%
isc_nm_resume(manager->nm);
}
LOCK(&manager->halt_lock);
- REQUIRE(atomic_load_relaxed(&manager->exclusive_req) == true);
+ REQUIRE(atomic_load_relaxed(&manager->exclusive_req));
atomic_store_relaxed(&manager->exclusive_req, false);
while (manager->halted > 0) {
BROADCAST(&manager->halt_cond);
}
/* For directories check the directory-specific bits */
- if (isdir == true) {
+ if (isdir) {
if ((caccess & ISC_FSACCESS_CREATECHILD) != 0) {
NTFSbits |= FILE_ADD_SUBDIRECTORY | FILE_ADD_FILE;
}
* cache there is no point in setting RA.
*/
ra = false;
- if (client->view->resolver != NULL && client->view->recursion == true &&
+ if (client->view->resolver != NULL && client->view->recursion &&
ns_client_checkaclsilent(client, NULL, client->view->recursionacl,
true) == ISC_R_SUCCESS &&
ns_client_checkaclsilent(client, NULL, client->view->cacheacl,
ra = true;
}
- if (ra == true) {
+ if (ra) {
client->attributes |= NS_CLIENTATTR_RA;
}
goto cleanup_interface;
}
- if (((mgr->sctx->options & NS_SERVER_NOTCP) == 0) && accept_tcp == true)
- {
+ if (((mgr->sctx->options & NS_SERVER_NOTCP) == 0) && accept_tcp) {
result = ns_interface_listentcp(ifp);
if (result != ISC_R_SUCCESS) {
if ((result == ISC_R_ADDRINUSE) &&
* unless explicitly allowed.
*/
#ifndef ISC_ALLOW_MAPPED
- if (scan_ipv6 == true && isc_net_probe_ipv6only() != ISC_R_SUCCESS) {
+ if (scan_ipv6 && isc_net_probe_ipv6only() != ISC_R_SUCCESS) {
ipv6only = false;
log_explicit = true;
}
#endif /* ifndef ISC_ALLOW_MAPPED */
- if (scan_ipv6 == true && isc_net_probe_ipv6pktinfo() != ISC_R_SUCCESS) {
+ if (scan_ipv6 && isc_net_probe_ipv6pktinfo() != ISC_R_SUCCESS) {
ipv6pktinfo = false;
log_explicit = true;
}
- if (scan_ipv6 == true && ipv6only && ipv6pktinfo) {
+ if (scan_ipv6 && ipv6only && ipv6pktinfo) {
for (le = ISC_LIST_HEAD(mgr->listenon6->elts); le != NULL;
le = ISC_LIST_NEXT(le, link))
{
continue;
}
- if (adjusting == false && dolistenon == true) {
+ if (adjusting == false && dolistenon) {
setup_listenon(mgr, &interface, le->port);
dolistenon = false;
}
* interface, we need to listen on the address
* explicitly.
*/
- if (adjusting == true) {
+ if (adjusting) {
ns_listenelt_t *ele;
match = 0;
match = 0;
}
}
- if (ipv6_wildcard == true && match == 0) {
+ if (ipv6_wildcard && match == 0) {
continue;
}
}
} else {
bool addr_in_use = false;
- if (adjusting == false && ipv6_wildcard == true)
- {
+ if (adjusting == false && ipv6_wildcard) {
continue;
}
"%s"
"listening on %s interface "
"%s, %s",
- (adjusting == true) ? "additionally "
- : "",
+ (adjusting) ? "additionally " : "",
(family == AF_INET) ? "IPv4" : "IPv6",
interface.name, sabuf);
result = ns_interface_setup(
mgr, &listen_sockaddr, interface.name,
- &ifp,
- (adjusting == true) ? false : true,
+ &ifp, (adjusting) ? false : true,
le->dscp, &addr_in_use);
tried_listening = true;
query_glueanswer(qctx);
if (qctx->client->message->rcode == dns_rcode_nxdomain &&
- qctx->view->auth_nxdomain == true)
+ qctx->view->auth_nxdomain)
{
qctx->client->message->flags |= DNS_MESSAGEFLAG_AA;
}
REQUIRE(test != NULL);
REQUIRE(test->id.description != NULL);
- REQUIRE(test->cache_entry_present == true ||
- test->cache_entry_flags == 0);
+ REQUIRE(test->cache_entry_present || test->cache_entry_flags == 0);
/*
* Interrupt execution if ns_query_done() is called.
static isc_result_t
ssu_checkrule(void *data, dns_rdataset_t *rrset) {
ssu_check_t *ssuinfo = data;
- bool result;
+ bool rule_ok;
/*
* If we're deleting all records, it's ok to delete RRSIG and NSEC even
rrset->type == dns_rdatatype_nsec) {
return (ISC_R_SUCCESS);
}
- result = dns_ssutable_checkrules(
+
+ rule_ok = dns_ssutable_checkrules(
ssuinfo->table, ssuinfo->signer, ssuinfo->name, ssuinfo->addr,
ssuinfo->tcp, ssuinfo->aclenv, rrset->type, ssuinfo->key);
- return (result == true ? ISC_R_SUCCESS : ISC_R_FAILURE);
+ return (rule_ok ? ISC_R_SUCCESS : ISC_R_FAILURE);
}
static bool
(void)isc_timer_touch(xfr->client->timer);
#endif /* if 0 */
- if (xfr->shuttingdown == true) {
+ if (xfr->shuttingdown) {
xfrout_maybe_destroy(xfr);
} else if (result != ISC_R_SUCCESS) {
xfrout_fail(xfr, result, "send");
static void
xfrout_maybe_destroy(xfrout_ctx_t *xfr) {
- INSIST(xfr->shuttingdown == true);
+ INSIST(xfr->shuttingdown);
#if 0
if (xfr->sends > 0) {
/*
dns_rdatatype_t type;
REQUIRE(task == probe_task);
- REQUIRE(trans != NULL && trans->inuse == true);
+ REQUIRE(trans != NULL && trans->inuse);
rmessage = rev->rmessage;
REQUIRE(rmessage == trans->rmessage);
INSIST(outstanding_probes > 0);
isc_result_t result;
REQUIRE(task == probe_task);
- REQUIRE(trans->inuse == true);
+ REQUIRE(trans->inuse);
REQUIRE(pns != NULL);
INSIST(outstanding_probes > 0);
struct probe_ns *pns;
REQUIRE(task == probe_task);
- REQUIRE(trans->inuse == true);
+ REQUIRE(trans->inuse);
INSIST(outstanding_probes > 0);
for (name = ISC_LIST_HEAD(rev->answerlist); name != NULL;
isc_result_t result;
REQUIRE(task == query_task);
- REQUIRE(trans->inuse == true);
+ REQUIRE(trans->inuse);
REQUIRE(outstanding_queries > 0);
printf("answer[%2d]\n", trans->id);