]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Don't attempt to close connections which never opened
authorNick Porter <nick@portercomputing.co.uk>
Fri, 11 Oct 2024 12:13:12 +0000 (13:13 +0100)
committerNick Porter <nick@portercomputing.co.uk>
Fri, 11 Oct 2024 13:59:16 +0000 (14:59 +0100)
src/lib/server/connection.c

index ff75f2261dbfcca1364bd7deed30ac79b5fc070c..c6ef11e01cf21789727f1356a646972649bff1f3 100644 (file)
@@ -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;