result = dns_db_findrdataset(db, node, ver, dns_rdatatype_ns, 0, 0,
&nsset, NULL);
if (dns_rdataset_isassociated(&nsset)) {
- if (ttlp != NULL) {
- *ttlp = nsset.ttl;
- }
+ SET_IF_NOT_NULL(ttlp, nsset.ttl);
dns_rdataset_disassociate(&nsset);
}
id, oldid);
}
} else {
- if (exact != NULL) {
- *exact = true;
- }
+ SET_IF_NOT_NULL(exact, true);
if (verbose > 1) {
fprintf(stderr, "Key ID %d exists\n",
id);
if (found != NULL && bcentry_alive(ht, found, now)) {
result = ISC_R_SUCCESS;
- if (flagp != NULL) {
- *flagp = found->flags;
- }
+ SET_IF_NOT_NULL(flagp, found->flags);
}
isc_tid_t tid = isc_tid();
continue;
}
- if (dep != NULL) {
- *dep = dst_key_id(d->key);
- }
+ SET_IF_NOT_NULL(dep, dst_key_id(d->key));
return true;
}
}
dns_namelist_t *section) {
ISC_LIST_FOREACH_REV(*section, name, link) {
if (dns_name_equal(name, target)) {
- if (foundname != NULL) {
- *foundname = name;
- }
+ SET_IF_NOT_NULL(foundname, name);
return ISC_R_SUCCESS;
}
}
* the deepest covering zone.
*/
if (!dns_nsec3_supportedhash(nsec3.hash)) {
- if (unknown != NULL) {
- *unknown = true;
- }
+ SET_IF_NOT_NULL(unknown, true);
return ISC_R_IGNORE;
}
if (REMOVE(rdata.data[1])) {
continue;
}
- if (build_nsec3 != NULL) {
- *build_nsec3 = true;
- }
+ SET_IF_NOT_NULL(build_nsec3, true);
break;
}
goto success;
* The last NSEC3 chain is being removed and does not have
* have NONSEC set.
*/
- if (build_nsec != NULL) {
- *build_nsec = true;
- }
+ SET_IF_NOT_NULL(build_nsec, true);
goto success;
}
if (signing) {
if (nsec3chain) {
- if (build_nsec3 != NULL) {
- *build_nsec3 = true;
- }
+ SET_IF_NOT_NULL(build_nsec3, true);
} else {
- if (build_nsec != NULL) {
- *build_nsec = true;
- }
+ SET_IF_NOT_NULL(build_nsec, true);
}
}
}
if (version->havensec3) {
- if (hash != NULL) {
- *hash = version->hash;
- }
+ SET_IF_NOT_NULL(hash, version->hash);
if (salt != NULL && salt_length != NULL) {
REQUIRE(*salt_length >= version->salt_length);
memmove(salt, version->salt, version->salt_length);
}
- if (salt_length != NULL) {
- *salt_length = version->salt_length;
- }
- if (iterations != NULL) {
- *iterations = version->iterations;
- }
- if (flags != NULL) {
- *flags = version->flags;
- }
+ SET_IF_NOT_NULL(salt_length, version->salt_length);
+ SET_IF_NOT_NULL(iterations, version->iterations);
+ SET_IF_NOT_NULL(flags, version->flags);
result = ISC_R_SUCCESS;
}
RWUNLOCK(&qpdb->lock, isc_rwlocktype_read);
* No addresses and no pending events: the find failed.
*/
if ((find->options & DNS_ADBFIND_OVERQUOTA) != 0) {
- if (overquota != NULL) {
- *overquota = true;
- }
+ SET_IF_NOT_NULL(overquota, true);
fctx->quotacount++; /* quota exceeded */
} else {
fctx->adberr++; /* unreachable server, etc. */
CHECK(dns_diff_sort(diff, temp_order));
state->state = sign_updates;
state->magic = STATE_MAGIC;
- if (statep != NULL) {
- *statep = state;
- }
+ SET_IF_NOT_NULL(statep, state);
} else {
REQUIRE(DNS_STATE_VALID(*statep));
state = *statep;
result = dns_db_findrdataset(vctx->db, node, vctx->ver,
dns_rdatatype_ns, 0, 0, &nsset, NULL);
if (dns_rdataset_isassociated(&nsset)) {
- if (ttlp != NULL) {
- *ttlp = nsset.ttl;
- }
+ SET_IF_NOT_NULL(ttlp, nsset.ttl);
dns_rdataset_disassociate(&nsset);
}
isc_nmhandle_detach(&tlshandle);
sock->tlsstream.state = TLS_IO;
- if (presult != NULL) {
- *presult = result;
- }
+ SET_IF_NOT_NULL(presult, result);
}
return rv;
if (kv != NULL) {
v = CDR(kv);
if (isccc_sexpr_stringp(v)) {
- if (strp != NULL) {
- *strp = isccc_sexpr_tostring(v);
- }
+ SET_IF_NOT_NULL(strp, isccc_sexpr_tostring(v));
return ISC_R_SUCCESS;
} else {
return ISC_R_EXISTS;
if (kv != NULL) {
v = CDR(kv);
if (isccc_sexpr_binaryp(v)) {
- if (r != NULL) {
- *r = isccc_sexpr_tobinary(v);
- }
+ SET_IF_NOT_NULL(r, isccc_sexpr_tobinary(v));
return ISC_R_SUCCESS;
} else {
return ISC_R_EXISTS;
if (kv != NULL) {
v = ISCCC_SEXPR_CDR(kv);
if (isccc_sexpr_binaryp(v)) {
- if (strp != NULL) {
- *strp = isccc_sexpr_tostring(v);
- }
+ SET_IF_NOT_NULL(strp, isccc_sexpr_tostring(v));
return ISC_R_SUCCESS;
} else {
return ISC_R_EXISTS;
if (kv != NULL) {
v = ISCCC_SEXPR_CDR(kv);
if (isccc_sexpr_binaryp(v)) {
- if (uintp != NULL) {
- *uintp = (uint32_t)strtoul(
- isccc_sexpr_tostring(v), NULL, 10);
- }
+ SET_IF_NOT_NULL(uintp, (uint32_t)strtoul(
+ isccc_sexpr_tostring(v),
+ NULL, 10));
return ISC_R_SUCCESS;
} else {
return ISC_R_EXISTS;
const char *aclname =
cfg_obj_asstring(cfg_tuple_get(acl, "name"));
if (strcasecmp(aclname, name) == 0) {
- if (ret != NULL) {
- *ret = cfg_tuple_get(acl, "value");
- }
+ SET_IF_NOT_NULL(ret, cfg_tuple_get(acl, "value"));
return ISC_R_SUCCESS;
}
}
const cfg_obj_t *negated = cfg_tuple_get(ce, "negated");
if (!cfg_obj_isvoid(negated)) {
ce = negated;
- if (has_negative != NULL) {
- *has_negative = true;
- }
+ SET_IF_NOT_NULL(has_negative, true);
}
}