diff --git a/src/lib/server/auth.c b/src/lib/server/auth.c index 764c2a2b9609b..775671df94373 100644 --- a/src/lib/server/auth.c +++ b/src/lib/server/auth.c @@ -174,7 +174,7 @@ unlang_action_t rad_virtual_server(rlm_rcode_t *p_result, request_t *request) RDEBUG("server %s {", cf_section_name2(unlang_call_current(request))); request->async->process(&final, - MODULE_CTX(module_instance_by_data(request->async->process_inst), NULL, NULL, NULL), + MODULE_CTX(module_rlm_by_data(request->async->process_inst), NULL, NULL, NULL), request); RDEBUG("} # server %s", cf_section_name2(unlang_call_current(request))); diff --git a/src/lib/server/module_rlm.c b/src/lib/server/module_rlm.c index a0f9efb9889f0..c9b997054ef4d 100644 --- a/src/lib/server/module_rlm.c +++ b/src/lib/server/module_rlm.c @@ -787,6 +787,11 @@ module_instance_t *module_rlm_by_name(module_instance_t const *parent, char cons return module_instance_by_name(rlm_modules, parent, asked_name); } +module_instance_t *module_rlm_by_data(module_instance_t const *data) +{ + return module_instance_by_data(rlm_modules, data); +} + /** Create a virtual module. * * @param[in] cs that defines the virtual module. diff --git a/src/lib/server/module_rlm.h b/src/lib/server/module_rlm.h index bc6487c43fafb..cdc637f50b2be 100644 --- a/src/lib/server/module_rlm.h +++ b/src/lib/server/module_rlm.h @@ -92,6 +92,8 @@ module_thread_instance_t *module_rlm_thread_by_data(void const *data); module_instance_t *module_rlm_by_name(module_instance_t const *parent, char const *asked_name); +module_instance_t *module_rlm_by_data(module_instance_t const *data); + CONF_SECTION *module_rlm_by_name_virtual(char const *asked_name); /** @} */ diff --git a/src/modules/rlm_mschap/rlm_mschap.c b/src/modules/rlm_mschap/rlm_mschap.c index 22544cf5b747f..7aca6ea770ee6 100644 --- a/src/modules/rlm_mschap/rlm_mschap.c +++ b/src/modules/rlm_mschap/rlm_mschap.c @@ -799,7 +799,7 @@ static int _mod_conn_free(struct wbcContext **wb_ctx) static void *mod_conn_create(TALLOC_CTX *ctx, void *instance, UNUSED fr_time_delta_t timeout) { struct wbcContext **wb_ctx; - module_inst_ctx_t *mctx = MODULE_INST_CTX(module_instance_by_data(instance)); + module_inst_ctx_t *mctx = MODULE_INST_CTX(module_rlm_by_data(instance)); wb_ctx = talloc_zero(ctx, struct wbcContext *); *wb_ctx = wbcCtxCreate();