Allow MSCS support to be disabled for testing purposes

"SET disable_mscs_support 1" can be used to disable indication of MSCS
support in the Extended Capabilities element for testing purposes. This
is also disabling addition of the MSCS element even if valid
configuration parameters had been configured.

Signed-off-by: Vinita S. Maloo <vmaloo@codeaurora.org>
This commit is contained in:
Vinita S. Maloo 2021-04-12 16:56:24 +05:30 committed by Jouni Malinen
parent 025f8ab52e
commit e433d06dd5
3 changed files with 17 additions and 4 deletions

View file

@ -832,6 +832,8 @@ static int wpa_supplicant_ctrl_iface_set(struct wpa_supplicant *wpa_s,
ret = wpas_ctrl_iface_set_dso(wpa_s, value);
} else if (os_strcasecmp(cmd, "disable_scs_support") == 0) {
wpa_s->disable_scs_support = !!atoi(value);
} else if (os_strcasecmp(cmd, "disable_mscs_support") == 0) {
wpa_s->disable_mscs_support = !!atoi(value);
#ifdef CONFIG_DPP
} else if (os_strcasecmp(cmd, "dpp_config_obj_override") == 0) {
os_free(wpa_s->dpp_config_obj_override);
@ -8554,6 +8556,7 @@ static void wpa_supplicant_ctrl_iface_flush(struct wpa_supplicant *wpa_s)
wpa_s->rsnxe_override_eapol = NULL;
wpas_clear_driver_signal_override(wpa_s);
wpa_s->disable_scs_support = 0;
wpa_s->disable_mscs_support = 0;
wpa_s->oci_freq_override_eapol = 0;
wpa_s->oci_freq_override_saquery_req = 0;
wpa_s->oci_freq_override_saquery_resp = 0;

View file

@ -1873,7 +1873,7 @@ int wpa_supplicant_set_suites(struct wpa_supplicant *wpa_s,
static void wpas_ext_capab_byte(struct wpa_supplicant *wpa_s, u8 *pos, int idx)
{
bool scs = true;
bool scs = true, mscs = true;
*pos = 0x00;
@ -1940,6 +1940,11 @@ static void wpas_ext_capab_byte(struct wpa_supplicant *wpa_s, u8 *pos, int idx)
#endif /* CONFIG_FILS */
break;
case 10: /* Bits 80-87 */
#ifdef CONFIG_TESTING_OPTIONS
if (wpa_s->disable_mscs_support)
mscs = false;
#endif /* CONFIG_TESTING_OPTIONS */
if (mscs)
*pos |= 0x20; /* Bit 85 - Mirrored SCS */
break;
}
@ -3239,6 +3244,10 @@ pfs_fail:
wpa_ie_len += wpa_s->rsnxe_len;
}
#ifdef CONFIG_TESTING_OPTIONS
if (wpa_s->disable_mscs_support)
goto mscs_end;
#endif /* CONFIG_TESTING_OPTIONS */
if (wpa_bss_ext_capab(bss, WLAN_EXT_CAPAB_MSCS) &&
wpa_s->robust_av.valid_config) {
struct wpabuf *mscs_ie;
@ -3254,7 +3263,7 @@ pfs_fail:
if (!mscs_ie) {
wpa_printf(MSG_INFO,
"MSCS: Failed to allocate MSCS IE");
goto mscs_fail;
goto mscs_end;
}
wpas_populate_mscs_descriptor_ie(&wpa_s->robust_av, mscs_ie);
@ -3268,7 +3277,7 @@ pfs_fail:
wpabuf_free(mscs_ie);
}
mscs_fail:
mscs_end:
if (ssid->multi_ap_backhaul_sta) {
size_t multi_ap_ie_len;

View file

@ -1493,6 +1493,7 @@ struct wpa_supplicant {
u8 scs_dialog_token;
#ifdef CONFIG_TESTING_OPTIONS
unsigned int disable_scs_support:1;
unsigned int disable_mscs_support:1;
#endif /* CONFIG_TESTING_OPTIONS */
struct dl_list active_scs_ids;
bool ongoing_scs_req;