ubus: skip neighbors which exceed their assoc limit
authorDavid Bauer <mail@david-bauer.net>
Wed, 16 Mar 2022 22:13:54 +0000 (23:13 +0100)
committerDavid Bauer <mail@david-bauer.net>
Fri, 18 Mar 2022 20:25:45 +0000 (21:25 +0100)
Don't add neighbors which can not be associated to due to their
max-assoc limit.

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

diff --git a/ubus.c b/ubus.c
index 7e764ffdf50378acffdd433d19298470cbad6704..79401e0c48597c6350309bfbb5b882f27ef886a4 100644 (file)
--- a/ubus.c
+++ b/ubus.c
@@ -588,6 +588,9 @@ usteer_add_nr_entry(struct usteer_node *ln, struct usteer_node *node)
        if (strcmp(ln->ssid, node->ssid) != 0)
                return false;
 
+       if (!usteer_policy_node_below_max_assoc(node))
+               return false;
+
        blobmsg_parse_array(policy, ARRAY_SIZE(tb), tb,
                            blobmsg_data(node->rrm_nr),
                            blobmsg_data_len(node->rrm_nr));