Skip to content
Snippets Groups Projects
Commit da3c8feb authored by Filip Matusiak's avatar Filip Matusiak
Browse files

Only remove stations with no active node from client hashtable

parent 1b7df590
No related branches found
No related tags found
No related merge requests found
Pipeline #209809 passed
......@@ -231,6 +231,23 @@ struct node *cntlr_find_node_with_bssid(struct controller *c, uint8_t *bssid)
return NULL;
}
/* find node to which given STA is connected */
struct node *cntlr_find_node_with_sta(struct controller *c, uint8_t *sta_mac)
{
struct node *n = NULL;
list_for_each_entry(n, &c->nodelist, list) {
struct sta *s = NULL;
list_for_each_entry(s, &n->stalist, list) {
if (!memcmp(s->macaddr, sta_mac, 6))
return n;
}
}
return NULL;
}
#if (EASYMESH_VERSION >= 6)
bool cntlr_radio_support_ap_wifi7(struct wifi7_radio_capabilities *wifi7_caps)
{
......@@ -547,9 +564,14 @@ static void cntlr_freeze_sta(struct controller *c, struct sta *s)
static void cntlr_remove_sta(struct controller *c, struct node *n, struct sta *s)
{
cntlr_freeze_sta(c, s);
struct node *curr_sta_node;
node_del_sta(n, s);
cntlr_del_sta(c->sta_table, s->macaddr);
curr_sta_node = cntlr_find_node_with_sta(c, s->macaddr);
if (!curr_sta_node) {
cntlr_freeze_sta(c, s);
cntlr_del_sta(c->sta_table, s->macaddr);
}
}
struct cmdu_buff *cntlr_query_sta_metric(struct controller *c, struct sta *s)
......
......@@ -367,6 +367,7 @@ struct node *cntlr_add_node(struct controller *c, uint8_t *almacaddr);
struct node *cntlr_alloc_node(struct controller *c, uint8_t *almacaddr);
struct node *cntlr_find_node(struct controller *c, uint8_t *almacaddr);
struct node *cntlr_find_node_with_bssid(struct controller *c, uint8_t *bssid);
struct node *cntlr_find_node_with_sta(struct controller *c, uint8_t *sta_mac);
struct netif_link *cntlr_alloc_link(struct controller *c,
uint8_t *upstream, uint8_t *downstream);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment