]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Ensure parent cleanup timer is disarmed following new TCP connection
authorNick Porter <nick@portercomputing.co.uk>
Mon, 13 Apr 2026 14:02:29 +0000 (15:02 +0100)
committerNick Porter <nick@portercomputing.co.uk>
Mon, 13 Apr 2026 14:39:34 +0000 (15:39 +0100)
src/lib/io/master.c

index 9f23eaa1ad502f7585eb3a8cf5a7f08422e655c6..e112dff2b11af4d0dec02a0f27445673384a4725 100644 (file)
@@ -1700,11 +1700,21 @@ have_client:
         *      let it read from the socket.
         */
        if (accept_fd >= 0) {
-               if (!fr_io_connection_alloc(inst, thread, client, accept_fd, &address, NULL)) {
+               connection = fr_io_connection_alloc(inst, thread, client, accept_fd, &address, NULL);
+               if (!connection) {
                        static fr_rate_limit_t alloc_failed;
 
                        RATE_LIMIT_LOCAL(thread ? &thread->rate_limit.conn_alloc_failed : &alloc_failed,
                                         ERROR, "Failed to allocate connection from client %s", client->radclient->shortname);
+                       return -1;
+               }
+
+               /*
+                *      The parent is in use - ensure the cleanup timer is disarmed.
+                */
+               if (fr_timer_armed(connection->parent->ev)) {
+                       FR_TIMER_DISARM_RETURN(connection->parent->ev);
+                       connection->parent->ready_to_delete = false;
                }
 
                return 0;