From f86ab9d04b24da97a59772b1158870c74d3f7cb1 Mon Sep 17 00:00:00 2001
From: Filip Matusiak <filip.matusiak@iopsys.eu>
Date: Tue, 4 Mar 2025 17:55:47 +0100
Subject: [PATCH] Consider old state in topology response before readding sta

---
 src/cntlr_map.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/cntlr_map.c b/src/cntlr_map.c
index e8af47f5..aee8dbc9 100644
--- a/src/cntlr_map.c
+++ b/src/cntlr_map.c
@@ -694,7 +694,7 @@ int handle_topology_response(void *cntlr, struct cmdu_buff *cmdu, struct node *n
 
 				s->de_sta->conn_time = conntime;
 				s->state = conntime != 0 ? STA_ASSOCIATED : STA_DISCONNECTED;
-				if (s->state == STA_ASSOCIATED) {
+				if (old_state != STA_ASSOCIATED && s->state == STA_ASSOCIATED) {
 					node_add_sta(n, s);
 					time(&s->assoc_time);
 
-- 
GitLab