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
This commit is contained in:
Yu Ouyang 2019-08-12 18:01:56 +08:00 • committed by nshrivas
commit 228afe9d1d

View file

@ -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,