Skip to content
Snippets Groups Projects
Commit 4abd4db5 authored by Anjan Chanda's avatar Anjan Chanda
Browse files

warn if STA is added/removed to/from node incorrectly

parent 3bfe3fed
Branches
No related tags found
1 merge request!444warn if STA is added/removed to/from node incorrectly
Pipeline #200075 passed
......@@ -484,6 +484,13 @@ void cntlr_bcn_metrics_timer_cb(atimer_t *t)
void node_add_sta(struct node *n, struct sta *s)
{
if (WARN_ON(node_find_sta(n, s->macaddr))) {
cntlr_dbg(LOG_STA,
"%s: Warn! STA " MACFMT " already in node " MACFMT"\n",
__func__, MAC2STR(s->macaddr), MAC2STR(n->almacaddr));
return;
}
memcpy(s->agent_almacaddr, n->almacaddr, 6);
list_add(&s->list, &n->stalist);
n->sta_count++;
......@@ -491,6 +498,13 @@ void node_add_sta(struct node *n, struct sta *s)
void node_del_sta(struct node *n, struct sta *s)
{
if (WARN_ON(!node_find_sta(n, s->macaddr))) {
cntlr_dbg(LOG_STA,
"%s: Warn! STA " MACFMT " not in node " MACFMT"\n",
__func__, MAC2STR(s->macaddr), MAC2STR(n->almacaddr));
return;
}
list_del(&s->list);
n->sta_count--;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment