node: skip neighbors exceeding assoc-limit
authorDavid Bauer <mail@david-bauer.net>
Sun, 31 Oct 2021 09:59:31 +0000 (10:59 +0100)
committerDavid Bauer <mail@david-bauer.net>
Sun, 28 Nov 2021 12:47:18 +0000 (13:47 +0100)
When creating the list of neighbor reports, skip nodes which can't
handle additional STAs.

Signed-off-by: David Bauer <mail@david-bauer.net>
node.c

diff --git a/node.c b/node.c
index 8e0b30d436100bb6eefda0e43ee092ad55a12b48..ee7d280e7e6262f8c7dc0c9e53850373be5b7717 100644 (file)
--- a/node.c
+++ b/node.c
@@ -114,6 +114,10 @@ usteer_node_get_next_neighbor(struct usteer_node *current_node, struct usteer_no
                if (strcmp(current_node->ssid, rn->node.ssid))
                        continue;
 
+               /* Skip nodes which can't handle additional STA */
+               if (rn->node.max_assoc && rn->node.n_assoc >= rn->node.max_assoc)
+                       continue;
+
                /* Check if this node is ranked lower than the last one */
                n1 = usteer_node_better_neighbor(last, &rn->node);
                n2 = usteer_node_better_neighbor(&rn->node, last);