From 8088d9d0caa20b94ec61c5d45bf118db562b44ce Mon Sep 17 00:00:00 2001 From: Jakob Olsson <jakob.olsson@iopsys.eu> Date: Fri, 24 Nov 2023 11:25:12 +0100 Subject: [PATCH] config: add hide_backhaul_bss option --- src/config.c | 21 +++++++++++---------- src/config.h | 2 ++ 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/config.c b/src/config.c index eb565f4e6..8bb3b571e 100644 --- a/src/config.c +++ b/src/config.c @@ -1220,16 +1220,9 @@ int uci_apply_m2(struct agent_config *cfg, char *interface_name, char *device, } while(0); if (multi_ap == 0x01) { - char buf[2] = {0}; - - if (wifi_get_section_option(UCI_WIRELESS, UCI_WLAN_IFACE, - "ifname", interface_name, - "hidden", buf, - sizeof(buf))) { - uci_set_wireless_interface_option(UCI_WIRELESS, - UCI_WLAN_IFACE, "ifname", interface_name, - "hidden", "1"); - } + uci_set_wireless_interface_option(UCI_WIRELESS, + UCI_WLAN_IFACE, "ifname", interface_name, + "hidden", (cfg->hide_bbss ? "1" : "")); } else { char buf[2] = {0}; @@ -1942,6 +1935,7 @@ static int agent_config_get_wifi_agent(struct agent_config *a, #ifdef VENDOR_EXTENSION A_EXTENSION_PLUGIN, #endif + A_HIDE_BBSS, NUM_POLICIES }; const struct uci_parse_option opts[] = { @@ -1967,6 +1961,7 @@ static int agent_config_get_wifi_agent(struct agent_config *a, #ifdef VENDOR_EXTENSION { .name = "extplugin", .type = UCI_TYPE_LIST }, #endif + { .name = "hide_backhaul_bss", .type = UCI_TYPE_STRING }, }; struct uci_option *tb[NUM_POLICIES]; int prefix_idx = 0; @@ -2075,6 +2070,12 @@ static int agent_config_get_wifi_agent(struct agent_config *a, } #endif + if (tb[A_HIDE_BBSS]) { + a->hide_bbss = !!atoi(tb[A_HIDE_BBSS]->v.string);; + } else + a->hide_bbss = true; + + return 0; } diff --git a/src/config.h b/src/config.h index 457c0b316..6ce6ba968 100644 --- a/src/config.h +++ b/src/config.h @@ -259,6 +259,8 @@ struct agent_config { /* list of extension plugins */ struct list_head extlist; #endif + bool hide_bbss; + struct policy_cfg *pcfg; /* policy section */ struct ctrl_select_cfg *cscfg; /* controller select section */ struct dyn_bh_cfg dbhcfg; /* dynamic backhaul section */ -- GitLab