From c9107149ede0d18b60e2659a814e1cfed9f31719 Mon Sep 17 00:00:00 2001
From: Filip Matusiak <filip.matusiak@iopsys.eu>
Date: Wed, 11 Jun 2025 16:08:46 +0200
Subject: [PATCH] Use STA_CONNECTED rather than STA_ASSOCIATED

---
 src/acs.c                 | 2 +-
 src/cntlr_commands_impl.c | 2 +-
 src/cntlr_map.c           | 6 +++---
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/acs.c b/src/acs.c
index 6fc7dd82..75c59029 100644
--- a/src/acs.c
+++ b/src/acs.c
@@ -673,7 +673,7 @@ static bool cntlr_acs_radio_is_bsta_connected(struct controller *cntlr, struct n
 				if (memcmp(iface->bss->bssid, s->de_sta->macaddr, sizeof(iface->bss->bssid)))
 					continue;
 
-				if (s->is_bsta && s->state == STA_ASSOCIATED)
+				if (s->is_bsta && s->state == STA_CONNECTED)
 					return true;
 			}
 		}
diff --git a/src/cntlr_commands_impl.c b/src/cntlr_commands_impl.c
index f407a646..70482629 100644
--- a/src/cntlr_commands_impl.c
+++ b/src/cntlr_commands_impl.c
@@ -3118,7 +3118,7 @@ static int _cntlr_status(struct controller *c, void *args, void *out, bool full)
 			blobmsg_add_string(bb, "bssid", bssstr);
 			blobmsg_add_macaddr(bb, "node", n->almacaddr);
 			blobmsg_add_string(bb, "type", !s->is_bsta ? "NON_IEEE1905" : "IEEE1905");
-			blobmsg_add_u8(bb, "associated", s->state == STA_ASSOCIATED ? 1 : 0);
+			blobmsg_add_u8(bb, "associated", s->state == STA_CONNECTED ? 1 : 0);
 
 			/* show association time in ISO8601 format */
 			timeinfo = localtime(&s->assoc_time);
diff --git a/src/cntlr_map.c b/src/cntlr_map.c
index e98bf2eb..0198d649 100644
--- a/src/cntlr_map.c
+++ b/src/cntlr_map.c
@@ -235,7 +235,7 @@ int handle_topology_notification(void *cntlr, struct cmdu_buff *cmdu,
 
 				time(&s->assoc_time);
 				memcpy(s->bssid, ev->bssid, 6);
-				s->state = STA_ASSOCIATED;
+				s->state = STA_CONNECTED;
 
 				if (memcmp(s->agent_almacaddr, n->almacaddr, 6)) {
 					/* associated to a new node - remove from the old one */
@@ -276,7 +276,7 @@ int handle_topology_notification(void *cntlr, struct cmdu_buff *cmdu,
 
 				time(&s->assoc_time);
 				memcpy(s->bssid, ev->bssid, 6);
-				s->state = STA_ASSOCIATED;
+				s->state = STA_CONNECTED;
 
 				node_add_sta(n, s);
 
@@ -298,7 +298,7 @@ int handle_topology_notification(void *cntlr, struct cmdu_buff *cmdu,
 
 		cntlr_info(LOG_STA, "%s: STA " MACFMT " %s Node " MACFMT"\n",
 			   __func__, MAC2STR(s->macaddr),
-			   s->state == STA_ASSOCIATED ? "associated to" : "disconnected from",
+			   s->state == STA_CONNECTED ? "associated to" : "disconnected from",
 			   MAC2STR(s->agent_almacaddr));
 
 		cntlr_update_sta_steer_data(c, s);
-- 
GitLab