Skip to content
Snippets Groups Projects

Limiting length of Wi-Fi BH links chains

Merged Kamil Zulewski requested to merge kamil_bh_max_hops_new into devel
Compare and
5 files
+ 83
0
Compare changes
  • Side-by-side
  • Inline
Files
5
+ 65
0
@@ -477,6 +477,71 @@ static int forall_node_update_neighbors(struct controller *c)
}
#endif
void cntrl_send_max_wifi_bh_hops_policy(struct controller *c)
{
struct node *node;
if (c->cfg.max_node_bh_hops == 0)
return;
trace("%s: max_node_bh_hops %d\n",
__func__, c->cfg.max_node_bh_hops);
list_for_each_entry(node, &c->nodelist, list) {
enum bh_control {
BLOCK = 0x00,
UNBLOCK = 0x01
} bh_control = UNBLOCK;
struct bh_topology_dev *bh_topo_dev =
find_bh_topology_device(node->alid);
struct netif_radio *radio;
if (!bh_topo_dev) {
err("%s: device not found in bh topo model, logical error.\n", __func__);
continue;
}
if (bh_topo_dev->bh_info.level_in_tree == UNKNOWN_TREE_LEVEL) {
warn("%s: Level in BH treee unknown for: " MACFMT "\n", __func__, MAC2STR(node->alid));
continue;
}
if (c->cfg.max_node_bh_hops <= bh_topo_dev->bh_info.wifi_hops_from_root)
bh_control = BLOCK;
list_for_each_entry(radio, &node->radiolist, list) {
struct netif_iface *iface;
list_for_each_entry(iface, &radio->iflist, list) {
/* cppcheck-suppress uninitvar */
if (iface->bss->is_bbss) {
const uint8_t NO_VALIDITY_PERIOD = 0;
uint8_t ALL_BSTAS[6] = {
0xff, 0xff, 0xff, 0xff, 0xff, 0xff
};
uint16_t mid;
trace("%s: sending BH assoc_mode %s, node al_mac: " MACFMT
", wifi_hops_from_root: %d, bssid: " MACFMT"\n",
__func__,
bh_control ? "UNBLOCK" : "BLOCK",
MAC2STR(node->alid),
bh_topo_dev->bh_info.wifi_hops_from_root,
MAC2STR(iface->bss->bssid));
cntlr_send_client_assoc_ctrl_request(
c, node->alid, iface->bss->bssid,
bh_control, NO_VALIDITY_PERIOD, 1,
ALL_BSTAS, &mid);
}
}
}
}
}
void cntlr_update_sta_steer_counters(struct controller *c,
uint8_t *sta_mac,
uint8_t *src_bssid,
Loading