From dedd64f027d24f93a5b1db7d5e3021ea95325f27 Mon Sep 17 00:00:00 2001 From: Rathees Kumar R Chinannan Date: Tue, 30 Jan 2024 14:21:08 +0530 Subject: [PATCH] wpa-supplicant: Set frequency parameter for SA query response frame. When sending SA query response, supplicant has to set frequency parameter on NL80211_CMD_FRAME command to send this frame on same link on which SA query request is received. If frequency is not set, then this action frame will be dropped on driver. Currently while framing SA query response, frequency value is taken from drv->assoc_freq and drv->assoc_freq value is set to zero in case of MLD on nl80211_connect_common function. Fix this by obtaining the frequency from SA query request receive and pass it to update on SA query response frame transmit. Change-Id: I9907382c6de05af63ccafcd9d1d8245bdbb6d811 Signed-off-by: Rathees Kumar R Chinannan --- wpa_supplicant/events.c | 2 +- wpa_supplicant/sme.c | 8 ++++---- wpa_supplicant/sme.h | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c index a044167..40090d5 100644 --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c @@ -4749,7 +4749,7 @@ static void wpas_event_rx_mgmt_action(struct wpa_supplicant *wpa_s, #ifdef CONFIG_SME if (category == WLAN_ACTION_SA_QUERY) { - sme_sa_query_rx(wpa_s, mgmt->da, mgmt->sa, payload, plen); + sme_sa_query_rx(wpa_s, mgmt->da, mgmt->sa, payload, plen, freq); return; } #endif /* CONFIG_SME */ diff --git a/wpa_supplicant/sme.c b/wpa_supplicant/sme.c index 42c0cdf..22d31a7 100644 --- a/wpa_supplicant/sme.c +++ b/wpa_supplicant/sme.c @@ -3400,7 +3400,7 @@ void sme_event_ch_switch(struct wpa_supplicant *wpa_s) static void sme_process_sa_query_request(struct wpa_supplicant *wpa_s, const u8 *sa, const u8 *data, - size_t len) + size_t len, int freq) { u8 resp[2 + WLAN_SA_QUERY_TR_ID_LEN + OCV_OCI_EXTENDED_LEN]; u8 resp_len = 2 + WLAN_SA_QUERY_TR_ID_LEN; @@ -3439,7 +3439,7 @@ static void sme_process_sa_query_request(struct wpa_supplicant *wpa_s, } #endif /* CONFIG_OCV */ - if (wpa_drv_send_action(wpa_s, wpa_s->assoc_freq, 0, wpa_s->bssid, + if (wpa_drv_send_action(wpa_s, freq, 0, wpa_s->bssid, wpa_s->own_addr, wpa_s->bssid, resp, resp_len, 0) < 0) wpa_msg(wpa_s, MSG_INFO, @@ -3482,7 +3482,7 @@ static void sme_process_sa_query_response(struct wpa_supplicant *wpa_s, void sme_sa_query_rx(struct wpa_supplicant *wpa_s, const u8 *da, const u8 *sa, - const u8 *data, size_t len) + const u8 *data, size_t len, int freq) { if (len < 1 + WLAN_SA_QUERY_TR_ID_LEN) return; @@ -3528,7 +3528,7 @@ void sme_sa_query_rx(struct wpa_supplicant *wpa_s, const u8 *da, const u8 *sa, #endif /* CONFIG_OCV */ if (data[0] == WLAN_SA_QUERY_REQUEST) - sme_process_sa_query_request(wpa_s, sa, data, len); + sme_process_sa_query_request(wpa_s, sa, data, len, freq); else if (data[0] == WLAN_SA_QUERY_RESPONSE) sme_process_sa_query_response(wpa_s, sa, data, len); } diff --git a/wpa_supplicant/sme.h b/wpa_supplicant/sme.h index c797d2e..410686d 100644 --- a/wpa_supplicant/sme.h +++ b/wpa_supplicant/sme.h @@ -30,7 +30,7 @@ void sme_event_unprot_disconnect(struct wpa_supplicant *wpa_s, const u8 *sa, const u8 *da, u16 reason_code); void sme_event_ch_switch(struct wpa_supplicant *wpa_s); void sme_sa_query_rx(struct wpa_supplicant *wpa_s, const u8 *da, const u8 *sa, - const u8 *data, size_t len); + const u8 *data, size_t len, int freq); void sme_state_changed(struct wpa_supplicant *wpa_s); void sme_disassoc_while_authenticating(struct wpa_supplicant *wpa_s, const u8 *prev_pending_bssid); -- 2.43.0