From: Nick Porter Date: Mon, 13 Apr 2026 14:02:29 +0000 (+0100) Subject: Ensure parent cleanup timer is disarmed following new TCP connection X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=fc4e925ed0ac1f3e3aaa0cd386c6e1c2b1fef4ce;p=thirdparty%2Ffreeradius-server.git Ensure parent cleanup timer is disarmed following new TCP connection --- diff --git a/src/lib/io/master.c b/src/lib/io/master.c index 9f23eaa1ad5..e112dff2b11 100644 --- a/src/lib/io/master.c +++ b/src/lib/io/master.c @@ -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;