From 8427e18c9854a054250e9e864a08f01374137c99 Mon Sep 17 00:00:00 2001 From: Evgeny Date: Thu, 2 Jul 2026 10:23:06 +0300 Subject: [PATCH] =?UTF-8?q?control=5Fserver:=20fix=20infinite=20loop=20in?= =?UTF-8?q?=20router=5Fconns=20aggregation=20=E2=80=94=20use=20read-only?= =?UTF-8?q?=20head->next=20traversal=20instead=20of=20get/put?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/control_server.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/control_server.c b/src/control_server.c index b693f3ce..ce03140c 100644 --- a/src/control_server.c +++ b/src/control_server.c @@ -1175,8 +1175,8 @@ static void send_metrics(struct control_server* server, struct control_client* c /* Fill router congestion metrics — aggregate over all router_conns */ memset(&rsp->router, 0, sizeof(rsp->router)); if (instance->router_conns) { - struct ll_entry* re; - while ((re = queue_data_get(instance->router_conns)) != NULL) { + struct ll_entry* re = instance->router_conns->head; + while (re) { struct ETCP_ROUTER_CONN* rc = (struct ETCP_ROUTER_CONN*)re; rsp->router.total_inflight += (uint32_t)(rc->tx_seq - rc->tx_acked); if (rc->send_q) rsp->router.total_send_q += (uint32_t)queue_entry_count(rc->send_q); @@ -1190,7 +1190,7 @@ static void send_metrics(struct control_server* server, struct control_client* c rsp->router.oob_dropped += rc->c_oob_dropped; rsp->router.stale_ack += rc->c_stale_ack; rsp->router.sign_fail += rc->c_sign_fail; - queue_data_put_with_index(instance->router_conns, re); + re = re->next; } rsp->router.total_conns = (uint32_t)queue_entry_count(instance->router_conns); }