#define MAYBE_LOCK(cd) \
do { \
if ((cd->flags & DNS_SDLZFLAG_THREADSAFE) == 0 && \
- cd->in_configure == false) \
+ !cd->in_configure) \
LOCK(&cd->lock); \
} while (0)
#define MAYBE_UNLOCK(cd) \
do { \
if ((cd->flags & DNS_SDLZFLAG_THREADSAFE) == 0 && \
- cd->in_configure == false) \
+ !cd->in_configure) \
UNLOCK(&cd->lock); \
} while (0)
#define MAYBE_LOCK(cd) \
do { \
if ((cd->flags & DNS_SDLZFLAG_THREADSAFE) == 0 && \
- cd->in_configure == false) \
+ !cd->in_configure) \
LOCK(&cd->lock); \
} while (0)
#define MAYBE_UNLOCK(cd) \
do { \
if ((cd->flags & DNS_SDLZFLAG_THREADSAFE) == 0 && \
- cd->in_configure == false) \
+ !cd->in_configure) \
UNLOCK(&cd->lock); \
} while (0)
}
while (bdbres == 0) {
- if (dlt == false) {
+ if (!dlt) {
printf("%.*s | %.*s\n", (int)bdbkey.size,
(char *)bdbkey.data, (int)bdbdata.size,
(char *)bdbdata.data);
* are performing a zone xfr and we
* could not find a host entry.
*/
- } else if (dir_list != NULL && foundHost == false) {
+ } else if (dir_list != NULL && !foundHost) {
continue;
}
} else { /* if we cannot stat entry, skip it. */
* are performing a zone xfr and we
* could not find a host entry.
*/
- } else if (dir_list != NULL && foundHost == false) {
+ } else if (dir_list != NULL && !foundHost) {
continue;
}
} else { /* if we cannot stat entry, skip it. */
continue;
}
- if (recursion == false && !dns_acl_isnone(acl)) {
+ if (!recursion && !dns_acl_isnone(acl)) {
cfg_obj_log(aclobj, logctx, ISC_LOG_WARNING,
"both \"recursion no;\" and "
"\"%s\" active%s%s",
* just kill the name here.
*/
if (!NAME_FETCH(name)) {
- INSIST(result == false);
+ INSIST(!result);
result = unlink_name(adb, name);
free_adbname(adb, &name);
if (result) {
* irefcnt ourselves, since it will not be
* automatically triggered by a name being unlinked.
*/
- INSIST(result == false);
+ INSIST(!result);
result = dec_adb_irefcnt(adb);
} else {
/*
*/
while (name != NULL) {
next_name = ISC_LIST_NEXT(name, plink);
- INSIST(result == false);
+ INSIST(!result);
result = kill_name(&name,
DNS_EVENT_ADBSHUTDOWN);
name = next_name;
(overmem || victim->last_used + ADB_STALE_MARGIN <= now))
{
RUNTIME_CHECK(
- kill_name(&victim, DNS_EVENT_ADBCANCELED) ==
- false);
+ !kill_name(&victim, DNS_EVENT_ADBCANCELED));
victims++;
}
name = ISC_LIST_HEAD(adb->names[bucket]);
while (name != NULL) {
next_name = ISC_LIST_NEXT(name, plink);
- INSIST(result == false);
+ INSIST(!result);
result = check_expire_namehooks(name, now);
if (!result) {
result = check_expire_name(&name, now);
entry = ISC_LIST_HEAD(adb->entries[bucket]);
while (entry != NULL) {
next_entry = ISC_LIST_NEXT(entry, plink);
- INSIST(result == false);
+ INSIST(!result);
result = check_expire_entry(adb, &entry, now);
entry = next_entry;
}
if (adb->name_sd[bucket]) {
DP(DEF_LEVEL, "dns_adb_createfind: returning "
"ISC_R_SHUTTINGDOWN");
- RUNTIME_CHECK(free_adbfind(adb, &find) == false);
+ RUNTIME_CHECK(!free_adbfind(adb, &find));
result = ISC_R_SHUTTINGDOWN;
goto out;
}
adbname = new_adbname(adb, name);
if (adbname == NULL) {
- RUNTIME_CHECK(free_adbfind(adb, &find) == false);
+ RUNTIME_CHECK(!free_adbfind(adb, &find));
result = ISC_R_NOMEMORY;
goto out;
}
/*
* Expire old entries, etc.
*/
- RUNTIME_CHECK(check_expire_namehooks(adbname, now) == false);
+ RUNTIME_CHECK(!check_expire_namehooks(adbname, now));
/*
* Do we know that the name is an alias?
entry = ai->entry;
ai->entry = NULL;
INSIST(DNS_ADBENTRY_VALID(entry));
- RUNTIME_CHECK(dec_entry_refcnt(adb, overmem, entry, true) ==
- false);
+ RUNTIME_CHECK(!dec_entry_refcnt(adb, overmem, entry, true));
free_adbaddrinfo(adb, &ai);
ai = ISC_LIST_HEAD(find->list);
}
isc_stdtime_get(&now);
for (i = 0; i < adb->nnames; i++) {
- RUNTIME_CHECK(cleanup_names(adb, i, now) == false);
+ RUNTIME_CHECK(!cleanup_names(adb, i, now));
}
for (i = 0; i < adb->nentries; i++) {
- RUNTIME_CHECK(cleanup_entries(adb, i, now) == false);
+ RUNTIME_CHECK(!cleanup_entries(adb, i, now));
}
dump_adb(adb, f, false, now);
* Call our cleanup routines.
*/
for (i = 0; i < adb->nnames; i++) {
- RUNTIME_CHECK(cleanup_names(adb, i, INT_MAX) == false);
+ RUNTIME_CHECK(!cleanup_names(adb, i, INT_MAX));
}
for (i = 0; i < adb->nentries; i++) {
- RUNTIME_CHECK(cleanup_entries(adb, i, INT_MAX) == false);
+ RUNTIME_CHECK(!cleanup_entries(adb, i, INT_MAX));
}
#ifdef DUMP_ADB_AFTER_CLEANING
if (!NAME_DEAD(adbname) && dns_name_equal(name, &adbname->name))
{
RUNTIME_CHECK(
- kill_name(&adbname, DNS_EVENT_ADBCANCELED) ==
- false);
+ !kill_name(&adbname, DNS_EVENT_ADBCANCELED));
}
adbname = nextname;
}
dns_name_issubdomain(&adbname->name, name)) {
ret = kill_name(&adbname,
DNS_EVENT_ADBCANCELED);
- RUNTIME_CHECK(ret == false);
+ RUNTIME_CHECK(!ret);
}
adbname = nextname;
}
isc_buffer_putstr(buffer, "; ");
}
isc_buffer_putstr(buffer, "}; ");
- if (entry->opts.in_memory == false) {
+ if (!entry->opts.in_memory) {
isc_buffer_putstr(buffer, "file \"");
result = dns_catz_generate_masterfilename(zone, entry, &buffer);
if (result != ISC_R_SUCCESS) {
dns_db_attach(db, &zone->db);
}
- if (zone->updatepending == false) {
+ if (!zone->updatepending) {
zone->updatepending = true;
isc_time_now(&now);
tdiff = isc_time_microdiff(&now, &zone->lastupdated) / 1000000;
* update callback in zone_startload or axfr_makedb, but we will
* call onupdate() artificially so we can register the callback here.
*/
- if (oldzone->db_registered == false) {
+ if (!oldzone->db_registered) {
result = dns_db_updatenotify_register(
db, dns_catz_dbupdate_callback, oldzone->catzs);
if (result == ISC_R_SUCCESS) {
dns_catz_zone_t *zone = NULL;
isc_ht_iter_current(iter, (void **)&zone);
- if (zone->active == false) {
+ if (!zone->active) {
char cname[DNS_NAME_FORMATSIZE];
dns_name_format(&zone->name, cname,
DNS_NAME_FORMATSIZE);
isc_result_t result;
REQUIRE(mctx != NULL);
- REQUIRE(dst_initialized == false);
+ REQUIRE(!dst_initialized);
UNUSED(engine);
if (key->func->sign == NULL) {
return (DST_R_NOTPRIVATEKEY);
}
- if (key->func->isprivate == NULL || key->func->isprivate(key) == false)
- {
+ if (key->func->isprivate == NULL || !key->func->isprivate(key)) {
return (DST_R_NOTPRIVATEKEY);
}
return (DST_R_KEYCANNOTCOMPUTESECRET);
}
- if (dst_key_isprivate(priv) == false) {
+ if (!dst_key_isprivate(priv)) {
return (DST_R_NOTPRIVATEKEY);
}
initialize(void) {
isc_result_t result;
- REQUIRE(initialize_done == false);
+ REQUIRE(!initialize_done);
isc_refcount_init(&references, 0);
*/
if ((ctx->style.flags & DNS_STYLEFLAG_NO_CLASS) == 0 &&
((ctx->style.flags & DNS_STYLEFLAG_OMIT_CLASS) == 0 ||
- ctx->class_printed == false))
+ !ctx->class_printed))
{
unsigned int class_start;
INDENT_TO(class_column);
*/
if ((ctx->style.flags & DNS_STYLEFLAG_TTL) != 0) {
- if (ctx->current_ttl_valid == false ||
+ if (!ctx->current_ttl_valid ||
ctx->current_ttl != rdataset->ttl) {
if ((ctx->style.flags & DNS_STYLEFLAG_COMMENT) != 0) {
isc_buffer_clear(buffer);
}
free_name = free_rdataset = false;
}
- INSIST(free_name == false);
- INSIST(free_rdataset == false);
+ INSIST(!free_name);
+ INSIST(!free_rdataset);
}
/*
static void
closeversion(dns_db_t *db, dns_dbversion_t **versionp, bool commit) {
REQUIRE(versionp != NULL && *versionp == (void *)&dummy);
- REQUIRE(commit == false);
+ REQUIRE(!commit);
UNUSED(db);
UNUSED(commit);
unsigned int labels;
REQUIRE(VALID_SDB(sdb));
- REQUIRE(create == false);
REQUIRE(nodep != NULL && *nodep == NULL);
UNUSED(name);
REQUIRE(nodep != NULL && *nodep == NULL);
if (sdlz->dlzimp->methods->newversion == NULL) {
- REQUIRE(create == false);
+ REQUIRE(!create);
}
isc_buffer_init(&b, namestr, sizeof(namestr));
char namestr[DNS_NAME_FORMATSIZE];
char creatorstr[DNS_NAME_FORMATSIZE];
- if (isc_log_wouldlog(dns_lctx, level) == false) {
+ if (!isc_log_wouldlog(dns_lctx, level)) {
return;
}
if (key != NULL) {
return;
}
- if (isc_log_wouldlog(dns_lctx, level) == false) {
+ if (!isc_log_wouldlog(dns_lctx, level)) {
return;
}
for (view = ISC_LIST_HEAD(*list); view != NULL;
view = ISC_LIST_NEXT(view, link))
{
- if (allclasses == false && view->rdclass != rdclass) {
+ if (!allclasses && view->rdclass != rdclass) {
continue;
}
const char *fmt, ...) {
va_list ap;
- if (isc_log_wouldlog(dns_lctx, level) == false) {
+ if (!isc_log_wouldlog(dns_lctx, level)) {
return;
}
va_list ap;
char zonetext[DNS_NAME_MAXTEXT + 32];
- if (isc_log_wouldlog(dns_lctx, level) == false) {
+ if (!isc_log_wouldlog(dns_lctx, level)) {
return;
}
#define DNS_ZONE_CHECKLOCK
#ifdef DNS_ZONE_CHECKLOCK
-#define LOCK_ZONE(z) \
- do { \
- LOCK(&(z)->lock); \
- INSIST((z)->locked == false); \
- (z)->locked = true; \
+#define LOCK_ZONE(z) \
+ do { \
+ LOCK(&(z)->lock); \
+ INSIST(!(z)->locked); \
+ (z)->locked = true; \
} while (0)
#define UNLOCK_ZONE(z) \
do { \
do { \
result = isc_mutex_trylock(&(z)->lock); \
if (result == ISC_R_SUCCESS) { \
- INSIST((z)->locked == false); \
+ INSIST(!(z)->locked); \
(z)->locked = true; \
} \
} while (0)
*/
#ifdef ENABLE_AFL
- if (dns_fuzzing_resolver == false) {
+ if (!dns_fuzzing_resolver) {
#endif /* ifdef ENABLE_AFL */
result = dns_resolver_createfetch(
zone->view->resolver, kname,
* Did we get a good answer from all the masters?
*/
for (j = 0; j < zone->masterscnt; j++) {
- if (zone->mastersok[j] == false) {
+ if (!zone->mastersok[j]) {
{
done = false;
break;
* Did we get a good answer from all the masters?
*/
for (j = 0; j < zone->masterscnt; j++) {
- if (zone->mastersok[j] == false) {
+ if (!zone->mastersok[j]) {
{
done = false;
break;
if (peer == NULL || result != ISC_R_SUCCESS) {
use_ixfr = zone->requestixfr;
}
- if (use_ixfr == false) {
+ if (!use_ixfr) {
dns_zone_logc(zone, DNS_LOGCATEGORY_XFER_IN,
ISC_LOG_DEBUG(1),
"IXFR disabled, "
* simply be made pending and we will get it when we call
* sigwait().
*/
- while (atomic_load_acquire(&ctx->want_shutdown) == false) {
+ while (!atomic_load_acquire(&ctx->want_shutdown)) {
#ifdef WIN32
DWORD dwWaitResult = WaitForMultipleObjects(
NUM_EVENTS, ctx->hEvents, FALSE, INFINITE);
/*
* Don't send the reload signal if we're shutting down.
*/
- if (atomic_load_acquire(&ctx->shutdown_requested) == false) {
+ if (!atomic_load_acquire(&ctx->shutdown_requested)) {
#ifdef WIN32
SetEvent(ctx->hEvents[RELOAD_EVENT]);
#else /* WIN32 */
bool
isc_astack_trypush(isc_astack_t *stack, void *obj) {
- if (isc_mutex_trylock(&stack->lock) == false) {
+ if (!isc_mutex_trylock(&stack->lock)) {
if (stack->pos >= stack->size) {
UNLOCK(&stack->lock);
return (false);
RUNTIME_CHECK(pthread_mutex_lock(&statslock) == 0);
- if (stats_init == false) {
+ if (!stats_init) {
stats_init = true;
}
socket_log(__LINE__, sock, NULL, CREATION,
"SOCKET INCONSISTENT: %s", crash_reason);
sock_dump(sock);
- INSIST(crash == false);
+ INSIST(!crash);
}
}
dns_compress_setsensitive(&cctx, true);
}
- if (client->view->msgcompression == false) {
+ if (!client->view->msgcompression) {
dns_compress_disable(&cctx);
}
}
isc_result_t result;
ns_interface_t *ifp = NULL;
REQUIRE(ifpret != NULL && *ifpret == NULL);
- REQUIRE(addr_in_use == NULL || *addr_in_use == false);
+ REQUIRE(addr_in_use == NULL || !*addr_in_use);
result = ns_interface_create(mgr, addr, name, &ifp);
if (result != ISC_R_SUCCESS) {
return (result);
}
- if (adjusting == false) {
+ if (!adjusting) {
result = clearacl(mgr->mctx, &mgr->aclenv.localhost);
if (result != ISC_R_SUCCESS) {
goto cleanup_iter;
if (family != AF_INET && family != AF_INET6) {
continue;
}
- if (scan_ipv4 == false && family == AF_INET) {
+ if (!scan_ipv4 && family == AF_INET) {
continue;
}
- if (scan_ipv6 == false && family == AF_INET6) {
+ if (!scan_ipv6 && family == AF_INET6) {
continue;
}
continue;
}
- if (adjusting == false) {
+ if (!adjusting) {
/*
* If running with -T fixedlocal, then we only
* want 127.0.0.1 and ::1 in the localhost ACL.
continue;
}
- if (adjusting == false && dolistenon) {
+ if (!adjusting && dolistenon) {
setup_listenon(mgr, &interface, le->port);
dolistenon = false;
}
} else {
bool addr_in_use = false;
- if (adjusting == false && ipv6_wildcard) {
+ if (!adjusting && ipv6_wildcard) {
continue;
}
static void
initialize(void) {
- REQUIRE(initialize_done == false);
+ REQUIRE(!initialize_done);
isc_mem_create(&ns_g_mctx);
sigrdataset = NULL;
}
- if (client->query.timerset == false) {
+ if (!client->query.timerset) {
ns_client_settimeout(client, 60);
}
return;
}
- if (isc_log_wouldlog(ns_lctx, level) == false) {
+ if (!isc_log_wouldlog(ns_lctx, level)) {
return;
}
xfrout_maybe_destroy(xfr);
} else if (result != ISC_R_SUCCESS) {
xfrout_fail(xfr, result, "send");
- } else if (xfr->end_of_stream == false) {
+ } else if (!xfr->end_of_stream) {
sendstream(xfr);
} else {
/* End of zone transfer stream. */
char *cp;
REQUIRE(trans != NULL);
- REQUIRE(trans->inuse == false);
+ REQUIRE(!trans->inuse);
REQUIRE(outstanding_probes < MAX_PROBES);
/* Construct domain */
char *cp;
REQUIRE(trans != NULL);
- REQUIRE(trans->inuse == false);
+ REQUIRE(!trans->inuse);
REQUIRE(ISC_LIST_EMPTY(trans->answerlist));
REQUIRE(outstanding_queries < MAX_QUERIES);
/* Sanity check */
for (i = 0; i < MAX_QUERIES; i++) {
- INSIST(query_array[i].inuse == false);
+ INSIST(!query_array[i].inuse);
}
/* Cleanup */