]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
MSCS: Send MSCS change/remove frames only if MSCS setup exists
authorVinita S. Maloo <vmaloo@codeaurora.org>
Tue, 4 Aug 2020 18:33:24 +0000 (00:03 +0530)
committerJouni Malinen <j@w1.fi>
Fri, 14 Aug 2020 08:53:37 +0000 (11:53 +0300)
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>
wpa_supplicant/robust_av.c
wpa_supplicant/sme.c
wpa_supplicant/wpa_supplicant.c
wpa_supplicant/wpa_supplicant_i.h

index 86f47d295a155ea2b781be2f4be5e6a7d7d03e50..31315517a045afbbd6dafed09932b2ebfd768049 100644 (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;
 }
index 789846905c807750f965116144ef30a665bb50ff..592c742fa25bf3026592f4aa1d6a3691f5836cc2 100644 (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;
index 9365c07177cc3f682fc69afdb15088be9e17c58c..3d2c0a98501a231ed807230af3e7de83e581415d 100644 (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) {
index 775590058f9018176c19e1bdd4e51e218ebff275..31a9b7427585978bf359b3faac9c0b0da49bc02f 100644 (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;
 };