diff --git a/lib/ns/hooks.h b/lib/ns/hooks.h index c16cebbf7f..36d148bdfd 100644 --- a/lib/ns/hooks.h +++ b/lib/ns/hooks.h @@ -57,7 +57,7 @@ * Consider the following sample code: * * ---------------------------------------------------------------------------- - * const ns_hook_t *foo_hook_table = NULL; + * ns_hook_t *foo_hook_table = NULL; * * isc_result_t * foo_bar(void) { @@ -81,7 +81,7 @@ * void * test_foo_bar(void) { * isc_boolean_t foo_bar_called = ISC_FALSE; - * const ns_hook_t my_hooks[FOO_HOOKS_COUNT] = { + * ns_hook_t my_hooks[FOO_HOOKS_COUNT] = { * [FOO_EXTRACT_VAL] = { * .callback = cause_failure, * .callback_data = &foo_bar_called, @@ -136,7 +136,7 @@ typedef struct ns_hook { #define NS_PROCESS_HOOK_VOID(table, id, data) \ _NS_PROCESS_HOOK(table, id, data) -LIBNS_EXTERNAL_DATA extern const ns_hook_t *ns__hook_table; +LIBNS_EXTERNAL_DATA extern ns_hook_t *ns__hook_table; #endif /* NS_HOOKS_ENABLE */ #endif /* NS_HOOKS_H */ diff --git a/lib/ns/query.c b/lib/ns/query.c index 8c9fa5c0c8..fdd2d7aad2 100644 --- a/lib/ns/query.c +++ b/lib/ns/query.c @@ -247,7 +247,7 @@ log_noexistnodata(void *val, int level, const char *fmt, ...) #ifdef NS_HOOKS_ENABLE -LIBNS_EXTERNAL_DATA const ns_hook_t *ns__hook_table = NULL; +LIBNS_EXTERNAL_DATA ns_hook_t *ns__hook_table = NULL; #define PROCESS_HOOK(...) \ NS_PROCESS_HOOK(ns__hook_table, __VA_ARGS__) diff --git a/lib/ns/tests/nstest.c b/lib/ns/tests/nstest.c index a47ee8aea0..642908e83b 100644 --- a/lib/ns/tests/nstest.c +++ b/lib/ns/tests/nstest.c @@ -679,8 +679,8 @@ extract_qctx(void *hook_data, void *callback_data, isc_result_t *resultp) { */ static isc_result_t create_qctx_for_client(ns_client_t *client, query_ctx_t **qctxp) { - const ns_hook_t *saved_hook_table; - const ns_hook_t query_hooks[NS_QUERY_HOOKS_COUNT] = { + ns_hook_t *saved_hook_table; + ns_hook_t query_hooks[NS_QUERY_HOOKS_COUNT] = { [NS_QUERY_SETUP_QCTX_INITIALIZED] = { .callback = extract_qctx, .callback_data = qctxp, diff --git a/lib/ns/tests/query_test.c b/lib/ns/tests/query_test.c index 7906989e54..ab8def3040 100644 --- a/lib/ns/tests/query_test.c +++ b/lib/ns/tests/query_test.c @@ -57,7 +57,7 @@ ns__query_sfcache_test(const ns__query_sfcache_test_params_t *test) { /* * Interrupt execution if query_done() is called. */ - const ns_hook_t query_hooks[NS_QUERY_HOOKS_COUNT] = { + ns_hook_t query_hooks[NS_QUERY_HOOKS_COUNT] = { [NS_QUERY_DONE_BEGIN] = { .callback = ns_test_hook_catch_call, .callback_data = NULL, @@ -264,7 +264,7 @@ ns__query_start_test(const ns__query_start_test_params_t *test) { /* * Interrupt execution if query_lookup() or query_done() is called. */ - const ns_hook_t query_hooks[NS_QUERY_HOOKS_COUNT] = { + ns_hook_t query_hooks[NS_QUERY_HOOKS_COUNT] = { [NS_QUERY_LOOKUP_BEGIN] = { .callback = ns_test_hook_catch_call, .callback_data = NULL,