2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-29 13:38:26 +00:00

Apply more SET_IF_NOT_NULL() changes

coccinelle v1.2 found more cases where the SET_IF_NOT_NULL macro
applies.
This commit is contained in:
Michal Nowak 2024-12-05 16:15:50 +01:00
parent f4377a3cd6
commit 57b64dc397
No known key found for this signature in database
5 changed files with 12 additions and 36 deletions

View File

@ -460,9 +460,7 @@ key_collision(dst_key_t *dstkey, dns_name_t *name, const char *dir,
dns_secalg_t alg; dns_secalg_t alg;
isc_stdtime_t now = isc_stdtime_now(); isc_stdtime_t now = isc_stdtime_now();
if (exact != NULL) { SET_IF_NOT_NULL(exact, false);
*exact = false;
}
id = dst_key_id(dstkey); id = dst_key_id(dstkey);
rid = dst_key_rid(dstkey); rid = dst_key_rid(dstkey);

View File

@ -2551,9 +2551,7 @@ dns_message_findname(dns_message_t *msg, dns_section_t section,
return result; return result;
} }
if (name != NULL) { SET_IF_NOT_NULL(name, foundname);
*name = foundname;
}
/* /*
* And now look for the type. * And now look for the type.

View File

@ -138,12 +138,8 @@ dns_private_chains(dns_db_t *db, dns_dbversion_t *ver,
if (dns_rdataset_isassociated(&nsecset) && if (dns_rdataset_isassociated(&nsecset) &&
dns_rdataset_isassociated(&nsec3paramset)) dns_rdataset_isassociated(&nsec3paramset))
{ {
if (build_nsec != NULL) { SET_IF_NOT_NULL(build_nsec, true);
*build_nsec = true; SET_IF_NOT_NULL(build_nsec3, true);
}
if (build_nsec3 != NULL) {
*build_nsec3 = true;
}
goto success; goto success;
} }
@ -160,12 +156,8 @@ dns_private_chains(dns_db_t *db, dns_dbversion_t *ver,
* Look to see if we also need to be creating a NSEC3 chain. * Look to see if we also need to be creating a NSEC3 chain.
*/ */
if (dns_rdataset_isassociated(&nsecset)) { if (dns_rdataset_isassociated(&nsecset)) {
if (build_nsec != NULL) { SET_IF_NOT_NULL(build_nsec, true);
*build_nsec = true; SET_IF_NOT_NULL(build_nsec3, false);
}
if (build_nsec3 != NULL) {
*build_nsec3 = false;
}
if (!dns_rdataset_isassociated(&privateset)) { if (!dns_rdataset_isassociated(&privateset)) {
goto success; goto success;
} }
@ -194,12 +186,8 @@ dns_private_chains(dns_db_t *db, dns_dbversion_t *ver,
} }
if (dns_rdataset_isassociated(&nsec3paramset)) { if (dns_rdataset_isassociated(&nsec3paramset)) {
if (build_nsec3 != NULL) { SET_IF_NOT_NULL(build_nsec3, true);
*build_nsec3 = true; SET_IF_NOT_NULL(build_nsec, false);
}
if (build_nsec != NULL) {
*build_nsec = false;
}
if (!dns_rdataset_isassociated(&privateset)) { if (!dns_rdataset_isassociated(&privateset)) {
goto success; goto success;
} }
@ -264,12 +252,8 @@ dns_private_chains(dns_db_t *db, dns_dbversion_t *ver,
goto success; goto success;
} }
if (build_nsec != NULL) { SET_IF_NOT_NULL(build_nsec, false);
*build_nsec = false; SET_IF_NOT_NULL(build_nsec3, false);
}
if (build_nsec3 != NULL) {
*build_nsec3 = false;
}
if (!dns_rdataset_isassociated(&privateset)) { if (!dns_rdataset_isassociated(&privateset)) {
goto success; goto success;
} }

View File

@ -1599,9 +1599,7 @@ dns_view_issecuredomain(dns_view_t *view, const dns_name_t *name,
return result; return result;
} }
if (ntap != NULL) { SET_IF_NOT_NULL(ntap, false);
*ntap = false;
}
if (checknta && secure && view->ntatable_priv != NULL && if (checknta && secure && view->ntatable_priv != NULL &&
dns_ntatable_covered(view->ntatable_priv, now, name, anchor)) dns_ntatable_covered(view->ntatable_priv, now, name, anchor))
{ {

View File

@ -209,9 +209,7 @@ count_acl_elements(const cfg_obj_t *caml, const cfg_obj_t *cctx,
REQUIRE(count != NULL); REQUIRE(count != NULL);
if (has_negative != NULL) { SET_IF_NOT_NULL(has_negative, false);
*has_negative = false;
}
for (elt = cfg_list_first(caml); elt != NULL; elt = cfg_list_next(elt)) for (elt = cfg_list_first(caml); elt != NULL; elt = cfg_list_next(elt))
{ {