From: Alan T. DeKok Date: Wed, 25 Apr 2018 15:49:34 +0000 (-0400) Subject: remove last vestiges of proto_radius knowledge from io.c X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=67ed7df4cce41b86d0b8e3d7a9a75b60c9a95ecf;p=thirdparty%2Ffreeradius-server.git remove last vestiges of proto_radius knowledge from io.c --- diff --git a/src/modules/proto_radius/io.c b/src/modules/proto_radius/io.c index a9e04e4f6e7..ef1cf71fe3b 100644 --- a/src/modules/proto_radius/io.c +++ b/src/modules/proto_radius/io.c @@ -1275,23 +1275,24 @@ static void mod_event_list_set(void *instance, fr_event_list_t *el, void *nr) get_inst(instance, &inst, &connection, &app_io_instance); /* - * Dynamic clients require an event list for cleanups. + * We're not doing IO, so there are no timers for + * cleaning up packets, dynamic clients, or connections. */ - if (!inst->io.dynamic_clients) { - /* - * Only Access-Request gets a cleanup delay. - */ - if (!inst->code_allowed[FR_CODE_ACCESS_REQUEST]) return; + if (!inst->io.submodule) return; - /* - * And then, only if cleanup delay is non-zero. - */ - if ((inst->io.cleanup_delay.tv_sec == 0) && - (inst->io.cleanup_delay.tv_usec == 0)) { - return; - } + /* + * No dynamic clients AND no packet cleanups? We don't + * need timers. + */ + if (!inst->io.dynamic_clients && + (inst->io.cleanup_delay.tv_sec == 0) && + (inst->io.cleanup_delay.tv_usec == 0)) { + return; } + /* + * Set event list and network side for this socket. + */ if (!connection) { inst->io.el = el; inst->io.nr = nr; diff --git a/src/modules/proto_radius/proto_radius.c b/src/modules/proto_radius/proto_radius.c index e7383aa99b5..91e6a7f7df1 100644 --- a/src/modules/proto_radius/proto_radius.c +++ b/src/modules/proto_radius/proto_radius.c @@ -894,6 +894,15 @@ static int mod_bootstrap(void *instance, CONF_SECTION *conf) FR_TIMEVAL_BOUND_CHECK("cleanup_delay", &inst->io.cleanup_delay, <=, 30, 0); + /* + * No Access-Request packets, then no cleanup delay. + */ + if (!inst->code_allowed[FR_CODE_ACCESS_REQUEST]) { + inst->io.cleanup_delay.tv_sec = 0; + inst->io.cleanup_delay.tv_usec = 0; + WARN("proto_radius - setting 'cleanup_delay = 0' as this listener does not receive Access-Request packets"); + } + /* * Hide this for now. It's only for people who know what * they're doing.