Merge branch '4360-fix-undefined-behaviours-detected-by-llvm-17' into 'main'

Resolve "Undefined behaviours detected by LLVM 17 (noop_accept_cb, dns__nta_shutdown_cb)"

Closes #4360

See merge request isc-projects/bind9!8376
This commit is contained in:
Arаm Sаrgsyаn 2023-10-13 11:15:02 +00:00
commit b54498abf6
4 changed files with 12 additions and 9 deletions

View file

@ -579,7 +579,9 @@ dns_ntatable_save(dns_ntatable_t *ntatable, FILE *fp) {
}
static void
dns__nta_shutdown_cb(dns__nta_t *nta) {
dns__nta_shutdown_cb(void *arg) {
dns__nta_t *nta = arg;
REQUIRE(VALID_NTA(nta));
if (isc_log_wouldlog(dns_lctx, ISC_LOG_DEBUG(3))) {
@ -602,7 +604,7 @@ dns__nta_shutdown(dns__nta_t *nta) {
REQUIRE(VALID_NTA(nta));
dns__nta_ref(nta);
isc_async_run(nta->loop, (isc_job_cb)dns__nta_shutdown_cb, nta);
isc_async_run(nta->loop, dns__nta_shutdown_cb, nta);
nta->shuttingdown = true;
}

View file

@ -634,7 +634,7 @@ resquery_connected(isc_result_t eresult, isc_region_t *region, void *arg);
static void
fctx_try(fetchctx_t *fctx, bool retrying, bool badcache);
static void
fctx_shutdown(fetchctx_t *fctx);
fctx_shutdown(void *arg);
static void
fctx_minimize_qname(fetchctx_t *fctx);
static void
@ -4369,7 +4369,9 @@ fctx_expired(void *arg) {
}
static void
fctx_shutdown(fetchctx_t *fctx) {
fctx_shutdown(void *arg) {
fetchctx_t *fctx = arg;
REQUIRE(VALID_FCTX(fctx));
fctx_done_unref(fctx, ISC_R_SHUTTINGDOWN);
@ -10151,8 +10153,7 @@ dns_resolver_shutdown(dns_resolver_t *res) {
INSIST(fctx != NULL);
fetchctx_ref(fctx);
isc_async_run(fctx->loop, (isc_job_cb)fctx_shutdown,
fctx);
isc_async_run(fctx->loop, fctx_shutdown, fctx);
}
isc_hashmap_iter_destroy(&it);
RWUNLOCK(&res->fctxs_lock, isc_rwlocktype_write);
@ -10495,7 +10496,7 @@ dns_resolver_createfetch(dns_resolver_t *res, const dns_name_t *name,
if (new_fctx) {
fetchctx_ref(fctx);
isc_async_run(fctx->loop, (isc_job_cb)fctx_start, fctx);
isc_async_run(fctx->loop, fctx_start, fctx);
}
unlock:

View file

@ -235,7 +235,7 @@ noop_recv_cb(isc_nmhandle_t *handle ISC_ATTR_UNUSED,
}
isc_result_t
noop_accept_cb(isc_nmhandle_t *handle ISC_ATTR_UNUSED, unsigned int eresult,
noop_accept_cb(isc_nmhandle_t *handle ISC_ATTR_UNUSED, isc_result_t eresult,
void *cbarg ISC_ATTR_UNUSED) {
F();

View file

@ -235,7 +235,7 @@ noop_recv_cb(isc_nmhandle_t *handle, isc_result_t eresult, isc_region_t *region,
void *cbarg);
isc_result_t
noop_accept_cb(isc_nmhandle_t *handle ISC_ATTR_UNUSED, unsigned int result,
noop_accept_cb(isc_nmhandle_t *handle ISC_ATTR_UNUSED, isc_result_t result,
void *cbarg ISC_ATTR_UNUSED);
void