From: Alan T. DeKok Date: Fri, 2 Nov 2018 15:24:13 +0000 (-0400) Subject: we shouldn't track which requests are using this module X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fba58424b032dbe4f41a7edd911e849c2d2000bd;p=thirdparty%2Ffreeradius-server.git we shouldn't track which requests are using this module the unlang interpreter does that. The rest of the code should guarantee that all requests are stopped / freed before a module is detached. --- diff --git a/src/modules/rlm_radius/rlm_radius.c b/src/modules/rlm_radius/rlm_radius.c index 3d2d13c4924..ceddbfde5c6 100644 --- a/src/modules/rlm_radius/rlm_radius.c +++ b/src/modules/rlm_radius/rlm_radius.c @@ -381,13 +381,9 @@ static int status_check_update_parse(TALLOC_CTX *ctx, void *out, UNUSED void *pa /** Free an rlm_radius_link_t * - * Unlink it from the running list, and remove it from the - * transport. */ static int mod_link_free(rlm_radius_link_t *link) { - fr_dlist_remove(&link->t->running, link); - /* * Free the child's request io context. That will call * the IO submodules destructor, which will remove it @@ -545,9 +541,7 @@ static rlm_rcode_t CC_HINT(nonnull) mod_process(void *instance, void *thread, RE } if (inst->io->request_inst_type) talloc_set_name_const(link->request_io_ctx, inst->io->request_inst_type); - link->t = t; link->request = request; - link->rcode = RLM_MODULE_FAIL; /* @@ -557,7 +551,6 @@ static rlm_rcode_t CC_HINT(nonnull) mod_process(void *instance, void *thread, RE */ radius_fixups(inst, request); - fr_dlist_insert_tail(&t->running, link); talloc_set_destructor(link, mod_link_free); /* @@ -812,8 +805,6 @@ static int mod_thread_instantiate(UNUSED CONF_SECTION const *cs, void *instance, t->inst = instance; t->el = el; - fr_dlist_init(&t->running, rlm_radius_link_t, entry); - /* * Allocate thread-specific data. The connections should * live here. @@ -852,18 +843,6 @@ static int mod_thread_detach(fr_event_list_t *el, void *thread) return -1; } - /* - * The scheduler MUST be destroyed before this modules - * thread memory is freed. That ordering ensures that - * all of the requests for a worker thread are forcibly - * marked DONE, and (in an ideal world) resumed / cleaned - * up before this memory is freed. - */ - if (fr_dlist_head(&t->running) != NULL) { - ERROR("Module still has running requests!"); - return -1; - } - return 0; } diff --git a/src/modules/rlm_radius/rlm_radius.h b/src/modules/rlm_radius/rlm_radius.h index 1bae7b50c62..a5c37af0ba9 100644 --- a/src/modules/rlm_radius/rlm_radius.h +++ b/src/modules/rlm_radius/rlm_radius.h @@ -112,8 +112,6 @@ typedef struct rlm_radius_thread_t { rlm_radius_t const *inst; //!< Instance of the module. fr_event_list_t *el; //!< This thread's event list. - fr_dlist_head_t running; //!< running requests - void *thread_io_ctx; //!< thread context for the IO submodule } rlm_radius_thread_t; @@ -122,8 +120,6 @@ typedef struct rlm_radius_thread_t { */ struct rlm_radius_link_t { REQUEST *request; //!< the request we are for, so we can find it from the link - rlm_radius_thread_t *t; //!< thread context for rlm_radius - fr_dlist_t entry; //!< linked list of active requests for rlm_radius fr_time_t time_sent; //!< when we sent the packet fr_time_t time_recv; //!< when we received the reply