MSCS: Send MSCS change/remove frames only if MSCS setup exists

Allow MSCS change/remove request to be sent only after an initial setup,
i.e., after an add request has been accepted.

Signed-off-by: Vinita S. Maloo <vmaloo@codeaurora.org>
This commit is contained in:
Vinita S. Maloo 2020-08-05 00:03:24 +05:30 committed by Jouni Malinen
parent af8ab3208d
commit d21dde9dac
4 changed files with 12 additions and 0 deletions

View file

@ -65,6 +65,13 @@ int wpas_send_mscs_req(struct wpa_supplicant *wpa_s)
return -1;
}
if (!wpa_s->mscs_setup_done &&
wpa_s->robust_av.request_type != SCS_REQ_ADD) {
wpa_msg(wpa_s, MSG_INFO,
"MSCS: Failed to send MSCS Request: request type invalid");
return -1;
}
buf_len = 3 + /* Action frame header */
3 + /* MSCS descriptor IE header */
1 + /* Request type */
@ -119,6 +126,7 @@ void wpas_handle_robust_av_recv_action(struct wpa_supplicant *wpa_s,
status_code = *buf;
wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_MSCS_RESULT "bssid=" MACSTR
" status_code=%u", MAC2STR(src), status_code);
wpa_s->mscs_setup_done = status_code == WLAN_STATUS_SUCCESS;
}
@ -145,4 +153,5 @@ void wpas_handle_assoc_resp_mscs(struct wpa_supplicant *wpa_s, const u8 *bssid,
status = WPA_GET_LE16(mscs_status + 2);
wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_MSCS_RESULT "bssid=" MACSTR
" status_code=%u", MAC2STR(bssid), status);
wpa_s->mscs_setup_done = status == WLAN_STATUS_SUCCESS;
}

View file

@ -1880,6 +1880,7 @@ void sme_associate(struct wpa_supplicant *wpa_s, enum wpas_mode mode,
pfs_fail:
#endif /* CONFIG_DPP2 */
wpa_s->mscs_setup_done = false;
if (wpa_s->current_bss && wpa_s->robust_av.valid_config) {
struct wpabuf *mscs_ie;
size_t mscs_ie_len, buf_len, *wpa_ie_len, max_ie_len;

View file

@ -3540,6 +3540,7 @@ static void wpas_start_assoc_cb(struct wpa_radio_work *work, int deinit)
wpa_sm_set_assoc_wpa_ie(wpa_s->wpa, NULL, 0);
wpa_sm_set_assoc_rsnxe(wpa_s->wpa, NULL, 0);
wpa_s->rsnxe_len = 0;
wpa_s->mscs_setup_done = false;
wpa_ie = wpas_populate_assoc_ies(wpa_s, bss, ssid, &params, NULL);
if (!wpa_ie) {

View file

@ -1327,6 +1327,7 @@ struct wpa_supplicant {
unsigned int multi_ap_backhaul:1;
unsigned int multi_ap_fronthaul:1;
struct robust_av_data robust_av;
bool mscs_setup_done;
};