diff --git a/src/config.c b/src/config.c index eb565f4e6057ac3c3d1da49694af6d2551db4665..8bb3b571e69412041b3177ef486d5a6d8feba644 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 457c0b316a3b92aac6d1000fa2d92286cd7afe57..6ce6ba968f5a4117d92b5a0eb78e6b29b43f6d59 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 */