]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
remove last vestiges of proto_radius knowledge from io.c
authorAlan T. DeKok <aland@freeradius.org>
Wed, 25 Apr 2018 15:49:34 +0000 (11:49 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 25 Apr 2018 16:53:45 +0000 (12:53 -0400)
src/modules/proto_radius/io.c
src/modules/proto_radius/proto_radius.c

index a9e04e4f6e74e3a559775df6861a9aa0a7d988f6..ef1cf71fe3b858fa08c7e273c28d9e0256e8ebe0 100644 (file)
@@ -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;
index e7383aa99b5fc108bc5f1c921ee3974d47457b57..91e6a7f7df1bb775e29970761490df07a8b468ab 100644 (file)
@@ -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.