From 228afe9d1daa2cf54803e2cd42be87eb2f770590 Mon Sep 17 00:00:00 2001 From: Yu Ouyang Date: Mon, 12 Aug 2019 18:01:56 +0800 Subject: [PATCH] qcacld-3.0: Fix ANI_AKM_TYPE_SAE undeclared issue ANI_AKM_TYPE_SAE is defined only when WLAN_FEATURE_SAE defined. But it is used without any checking in function lim_check_wpa_rsn_ie(). If WLAN_FEATURE_SAE is disabled, build error will occur. It is easy to fix it to add '#ifdef WLAN_FEATURE_SAE' in function lim_check_wpa_rsn_ie(). But coding rule, '#ifdef WLAN_FEATURE_SAE' isn't allowed to occur in function. So, move '(*akm_type == ANI_AKM_TYPE_SAE)' to function lim_check_sae_pmf_cap(). Change-Id: Id62bc69d770dbd4e470d8fa379b4cb3f7447d9dc CRs-Fixed: 2508071 --- core/mac/src/pe/lim/lim_process_assoc_req_frame.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/core/mac/src/pe/lim/lim_process_assoc_req_frame.c b/core/mac/src/pe/lim/lim_process_assoc_req_frame.c index e705137d1f1d..f554d823b671 100644 --- a/core/mac/src/pe/lim/lim_process_assoc_req_frame.c +++ b/core/mac/src/pe/lim/lim_process_assoc_req_frame.c @@ -916,6 +916,7 @@ static enum mac_status_code lim_check_wpa_ie(struct pe_session *session, * lim_check_sae_pmf_cap() - check pmf capability for SAE STA * @session: pointer to pe session entry * @rsn: pointer to RSN + * @akm_type: AKM type * * This function checks if SAE STA is pmf capable when SAE SAP is pmf * capable. Reject with eSIR_MAC_ROBUST_MGMT_FRAMES_POLICY_VIOLATION @@ -925,19 +926,22 @@ static enum mac_status_code lim_check_wpa_ie(struct pe_session *session, */ #ifdef WLAN_FEATURE_SAE static enum mac_status_code lim_check_sae_pmf_cap(struct pe_session *session, - tDot11fIERSN *rsn) + tDot11fIERSN *rsn, + enum ani_akm_type akm_type) { enum mac_status_code status = eSIR_MAC_SUCCESS_STATUS; if (session->pLimStartBssReq->pmfCapable && - (rsn->RSN_Cap[0] & WLAN_CRYPTO_RSN_CAP_MFP_ENABLED) == 0) + (rsn->RSN_Cap[0] & WLAN_CRYPTO_RSN_CAP_MFP_ENABLED) == 0 && + akm_type == ANI_AKM_TYPE_SAE) status = eSIR_MAC_ROBUST_MGMT_FRAMES_POLICY_VIOLATION_STATUS; return status; } #else static enum mac_status_code lim_check_sae_pmf_cap(struct pe_session *session, - tDot11fIERSN *rsn) + tDot11fIERSN *rsn, + enum ani_akm_type akm_type) { return eSIR_MAC_SUCCESS_STATUS; } @@ -1037,8 +1041,8 @@ static bool lim_check_wpa_rsn_ie(struct pe_session *session, *akm_type = lim_translate_rsn_oui_to_akm_type( dot11f_ie_rsn.akm_suite[0]); - if (*akm_type == ANI_AKM_TYPE_SAE) - status = lim_check_sae_pmf_cap(session, &dot11f_ie_rsn); + status = lim_check_sae_pmf_cap(session, &dot11f_ie_rsn, + *akm_type); if (eSIR_MAC_SUCCESS_STATUS != status) { /* Reject pmf disable SAE STA */ pe_warn("Re/Assoc rejected from: " QDF_MAC_ADDR_STR,