From: Nick Porter Date: Fri, 11 Oct 2024 12:13:12 +0000 (+0100) Subject: Don't attempt to close connections which never opened X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f71dc1bc2b981a26e42413c45039187839a7455e;p=thirdparty%2Ffreeradius-server.git Don't attempt to close connections which never opened --- diff --git a/src/lib/server/connection.c b/src/lib/server/connection.c index ff75f2261db..c6ef11e01cf 100644 --- a/src/lib/server/connection.c +++ b/src/lib/server/connection.c @@ -1312,13 +1312,17 @@ void connection_signal_halt(connection_t *conn) * must have completed INIT which means it has * an active handle which needs to be closed before * the connection is halted. + * + * The exception is when a connection fails to open + * so goes from INIT -> FAILED, means is_closed + * is true, as the connection has never opened. */ case CONNECTION_STATE_CONNECTED: case CONNECTION_STATE_CONNECTING: case CONNECTION_STATE_SHUTDOWN: case CONNECTION_STATE_TIMEOUT: case CONNECTION_STATE_FAILED: - connection_state_enter_closed(conn); + if (!conn->is_closed) connection_state_enter_closed(conn); fr_assert(conn->is_closed); connection_state_enter_halted(conn); break;