qcacld-3.0: vdev_id misused when handling DEAUTH ind

When STA receives DEAUTH ind event from target, vdev_id will be
mis-used as PE session ID when invoking lim_tear_down_link_with_ap.

Also enhanced related log for more useful info.

Change-Id: I755e0e170c36205ef20a21955546cc36437c1be4
CRs-Fixed: 2491669
This commit is contained in:
Lin Bai 2019-07-25 12:54:39 +08:00 • committed by nshrivas
commit 6b0efbae45
3 changed files with 28 additions and 25 deletions

View file

@ -2294,7 +2294,7 @@ pe_disconnect_callback(struct mac_context *mac, uint8_t vdev_id,
lim_extract_ies_from_deauth_disassoc(session, deauth_disassoc_frame,
deauth_disassoc_frame_len);
lim_tear_down_link_with_ap(mac, vdev_id,
lim_tear_down_link_with_ap(mac, session->peSessionId,
eSIR_MAC_UNSPEC_FAILURE_REASON);
return QDF_STATUS_SUCCESS;

View file

@ -373,7 +373,8 @@ lim_tear_down_link_with_ap(struct mac_context *mac, uint8_t sessionId,
*/
pe_session->pmmOffloadInfo.bcnmiss = false;
pe_info("No ProbeRsp from AP after HB failure. Tearing down link");
pe_info("No ProbeRsp from AP after HB failure for pe/sme id %d/%d",
pe_session->peSessionId, pe_session->smeSessionId);
/* Announce loss of link to Roaming algorithm */
/* and cleanup by sending SME_DISASSOC_REQ to SME */
@ -405,28 +406,28 @@ lim_tear_down_link_with_ap(struct mac_context *mac, uint8_t sessionId,
qdf_mem_copy((uint8_t *) &mlmDeauthInd.peerMacAddr,
sta->staAddr, sizeof(tSirMacAddr));
/*
* if deauth_before_connection is enabled and reasoncode is
* Beacon Missed Store the MAC of AP in the flip flop
* buffer. This MAC will be used to send Deauth before
* connection, if we connect to same AP after HB failure.
*/
if (mac->mlme_cfg->sta.deauth_before_connection &&
eSIR_BEACON_MISSED == reasonCode) {
int apCount = mac->lim.gLimHeartBeatApMacIndex;
/*
* if deauth_before_connection is enabled and reasoncode is
* Beacon Missed Store the MAC of AP in the flip flop
* buffer. This MAC will be used to send Deauth before
* connection, if we connect to same AP after HB failure.
*/
if (mac->mlme_cfg->sta.deauth_before_connection &&
eSIR_BEACON_MISSED == reasonCode) {
int apCount = mac->lim.gLimHeartBeatApMacIndex;
if (mac->lim.gLimHeartBeatApMacIndex)
mac->lim.gLimHeartBeatApMacIndex = 0;
else
mac->lim.gLimHeartBeatApMacIndex = 1;
if (mac->lim.gLimHeartBeatApMacIndex)
mac->lim.gLimHeartBeatApMacIndex = 0;
else
mac->lim.gLimHeartBeatApMacIndex = 1;
pe_debug("HB Failure on MAC "
QDF_MAC_ADDR_STR" Store it on Index %d",
QDF_MAC_ADDR_ARRAY(sta->staAddr), apCount);
pe_debug("HB Failure on MAC "
QDF_MAC_ADDR_STR" Store it on Index %d",
QDF_MAC_ADDR_ARRAY(sta->staAddr), apCount);
sir_copy_mac_addr(mac->lim.gLimHeartBeatApMac[apCount],
sta->staAddr);
}
sir_copy_mac_addr(mac->lim.gLimHeartBeatApMac[apCount],
sta->staAddr);
}
mlmDeauthInd.reasonCode =
(uint8_t) sta->mlmStaContext.disassocReason;

View file

@ -11495,8 +11495,10 @@ csr_roam_chk_lnk_deauth_ind(struct mac_context *mac_ctx, tSirSmeRsp *msg_ptr)
QDF_STATUS status;
struct deauth_ind *pDeauthInd;
sme_debug("DEAUTHENTICATION Indication from MAC");
pDeauthInd = (struct deauth_ind *)msg_ptr;
sme_debug("DEAUTH Indication from MAC for session %d bssid %pM",
pDeauthInd->sessionId, pDeauthInd->bssid.bytes);
status = csr_roam_get_session_id_from_bssid(mac_ctx,
&pDeauthInd->bssid,
&sessionId);