diff --git a/src/agent.c b/src/agent.c index 9c8eb0c9de966ce3d061c5864d8ed6f694ec10c5..afa06ee07d71d2e3d70d387f3fbc05bbc9e1afcf 100644 --- a/src/agent.c +++ b/src/agent.c @@ -3424,6 +3424,18 @@ static void agent_update_active_uplink(struct agent *a, char *ifname) runCmd("/lib/wifi/multiap set_uplink wifi %s", ifname); } +static bool wifi_is_band_onboarded(struct agent *a, enum wifi_band band) +{ + struct agent_config_radio *rcfg = NULL; + + list_for_each_entry(rcfg, &a->cfg.radiolist, list) { + if (rcfg->onboarded && rcfg->band == band) + return true; + } + + return false; +} + static void wifi_bsta_connect(struct agent *a, struct netif_bk *bk, uint8_t *bssid) { @@ -3431,6 +3443,13 @@ static void wifi_bsta_connect(struct agent *a, struct netif_bk *bk, char fmt[64] = {0}; int bssid_expired = 0; + /* no operation if no bsta on same band is onboarded! */ + if (!wifi_is_band_onboarded(a, bk->cfg->band)) { + dbg("|%s:%d| band %d is not onboard\n", __func__, __LINE__, + bk->cfg->band); + return; + } + bk->connected = true; a->connected = true; diff --git a/src/config.c b/src/config.c index a8982ea57ce6ed4ae2ee365baa72d2c11a26f0ea..15c1637b4547dde78d2be13e36f3717e06055e80 100644 --- a/src/config.c +++ b/src/config.c @@ -1986,13 +1986,23 @@ static int agent_config_get_wifi_radio(struct agent_config *a, strncpy(n->name, ifname, 16); n->name[15] = '\0'; - n->band = band; + if (band == 2) + n->band = BAND_2; + else if (band == 5) + n->band = BAND_5; + else + n->band = BAND_UNKNOWN; if (tb[WIFI_RADIO_CONFIGURED]) { n->configured = atoi(tb[WIFI_RADIO_CONFIGURED]->v.string) == 1 ? true : false; } + if (tb[WIFI_RADIO_ONBOARDED]) { + n->onboarded = atoi(tb[WIFI_RADIO_ONBOARDED]->v.string) == 1 ? + true : false; + } + if (tb[WIFI_RADIO_DEDICATED]) { n->dedicated_backhaul = atoi(tb[WIFI_RADIO_DEDICATED]->v.string) == 1 ? true : false;