Apply CHAN_SWITCH in all BSS for MBSSID case

When the CHAN_SWITCH command is executed during multi BSSID case (say
BSS1, BSS2, and BSS3), if one of the BSS is disabled (say BSS2), the
CHAN_SWITCH command returns an error in BSS2 and does not proceed to the
next BSS (BSS3).

The CHAN_SWITCH command handler iterates over all configured BSSs and
attempts to send the switch_channel to each one. However, if any one of
the BSSs fails, the entire command is aborted and returns a failure.

Continue the iteration even if one BSS is failing to make sure the
configuration is applied to other BSSs.

Signed-off-by: Haribabu Krishnasamy <quic_hkr@quicinc.com>
This commit is contained in:
Haribabu Krishnasamy 2024-01-25 12:17:51 +05:30 committed by Jouni Malinen
parent 39da3c7c63
commit 352ad5f1a2
2 changed files with 10 additions and 8 deletions

View file

@ -2638,6 +2638,8 @@ static int hostapd_ctrl_iface_chan_switch(struct hostapd_iface *iface,
unsigned int i; unsigned int i;
int bandwidth; int bandwidth;
u8 chan; u8 chan;
unsigned int num_err = 0;
int err = 0;
ret = hostapd_parse_csa_settings(pos, &settings); ret = hostapd_parse_csa_settings(pos, &settings);
if (ret) if (ret)
@ -2721,15 +2723,14 @@ static int hostapd_ctrl_iface_chan_switch(struct hostapd_iface *iface,
hostapd_chan_switch_config(iface->bss[i], hostapd_chan_switch_config(iface->bss[i],
&settings.freq_params); &settings.freq_params);
ret = hostapd_switch_channel(iface->bss[i], &settings); err = hostapd_switch_channel(iface->bss[i], &settings);
if (ret) { if (err) {
/* FIX: What do we do if CSA fails in the middle of ret = err;
* submitting multi-BSS CSA requests? */ num_err++;
return ret;
} }
} }
return 0; return (iface->num_bss == num_err) ? ret : 0;
#else /* NEED_AP_MLME */ #else /* NEED_AP_MLME */
return -1; return -1;
#endif /* NEED_AP_MLME */ #endif /* NEED_AP_MLME */

View file

@ -972,6 +972,7 @@ static int hostapd_dfs_request_channel_switch(struct hostapd_iface *iface,
struct csa_settings csa_settings; struct csa_settings csa_settings;
u8 new_vht_oper_chwidth; u8 new_vht_oper_chwidth;
unsigned int i; unsigned int i;
unsigned int num_err = 0;
wpa_printf(MSG_DEBUG, "DFS will switch to a new channel %d", channel); wpa_printf(MSG_DEBUG, "DFS will switch to a new channel %d", channel);
wpa_msg(iface->bss[0]->msg_ctx, MSG_INFO, DFS_EVENT_NEW_CHANNEL wpa_msg(iface->bss[0]->msg_ctx, MSG_INFO, DFS_EVENT_NEW_CHANNEL
@ -1021,10 +1022,10 @@ static int hostapd_dfs_request_channel_switch(struct hostapd_iface *iface,
for (i = 0; i < iface->num_bss; i++) { for (i = 0; i < iface->num_bss; i++) {
err = hostapd_switch_channel(iface->bss[i], &csa_settings); err = hostapd_switch_channel(iface->bss[i], &csa_settings);
if (err) if (err)
break; num_err++;
} }
if (err) { if (num_err == iface->num_bss) {
wpa_printf(MSG_WARNING, wpa_printf(MSG_WARNING,
"DFS failed to schedule CSA (%d) - trying fallback", "DFS failed to schedule CSA (%d) - trying fallback",
err); err);