From: Nick Porter Date: Thu, 17 Aug 2023 17:01:14 +0000 (+0100) Subject: Remove closed connections from the parent's tracking list X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bac1129ed8dab05a976fd97cbcd6df98276104ff;p=thirdparty%2Ffreeradius-server.git Remove closed connections from the parent's tracking list --- diff --git a/src/lib/io/master.c b/src/lib/io/master.c index 6ea24d45d2c..b17942d4999 100644 --- a/src/lib/io/master.c +++ b/src/lib/io/master.c @@ -2574,6 +2574,7 @@ static int mod_close(fr_listen_t *li) fr_io_instance_t const *inst; fr_io_connection_t *connection; fr_listen_t *child; + fr_io_client_t *parent; get_inst(li, &inst, NULL, &connection, &child); @@ -2597,6 +2598,15 @@ static int mod_close(fr_listen_t *li) if (connection->client->pending) { TALLOC_FREE(connection->client->pending); /* for any pending packets */ } + + /* + * Remove the connection from the parent's connection set + */ + parent = connection->parent; + pthread_mutex_lock(&parent->mutex); + fr_hash_table_remove(parent->ht, connection); + pthread_mutex_unlock(&parent->mutex); + talloc_free(connection->dl_inst); return 0;