diff --git a/core/mac/src/pe/include/lim_api.h b/core/mac/src/pe/include/lim_api.h index e24fba26d229..4bb6e649f78f 100644 --- a/core/mac/src/pe/include/lim_api.h +++ b/core/mac/src/pe/include/lim_api.h @@ -102,6 +102,7 @@ typedef enum eMgmtFrmDropReason { eMGMT_DROP_NON_SCAN_MODE_FRAME, eMGMT_DROP_INVALID_SIZE, eMGMT_DROP_SPURIOUS_FRAME, + eMGMT_DROP_DUPLICATE_AUTH_FRAME, } tMgmtFrmDropReason; /** diff --git a/core/mac/src/pe/lim/lim_api.c b/core/mac/src/pe/lim/lim_api.c index 713a73222901..6dbc21c5d048 100644 --- a/core/mac/src/pe/lim/lim_api.c +++ b/core/mac/src/pe/lim/lim_api.c @@ -46,6 +46,7 @@ #include "lim_ibss_peer_mgmt.h" #include "lim_admit_control.h" #include "lim_send_sme_rsp_messages.h" +#include "lim_security_utils.h" #include "wmm_apsd.h" #include "lim_trace.h" #include "lim_ft_defs.h" @@ -2604,6 +2605,25 @@ tMgmtFrmDropReason lim_is_pkt_candidate_for_drop(tpAniSirGlobal pMac, /* Drop the Probe Request in IBSS mode, if STA did not send out the last beacon */ /* In IBSS, the node which sends out the beacon, is supposed to respond to ProbeReq */ return eMGMT_DROP_NOT_LAST_IBSS_BCN; + } else if (subType == SIR_MAC_MGMT_AUTH) { + uint16_t curr_seq_num = 0; + struct tLimPreAuthNode *auth_node; + + pHdr = WMA_GET_RX_MAC_HEADER(pRxPacketInfo); + psessionEntry = pe_find_session_by_bssid(pMac, pHdr->bssId, + &sessionId); + if (!psessionEntry) + return eMGMT_DROP_NO_DROP; + + curr_seq_num = ((pHdr->seqControl.seqNumHi << 4) | + (pHdr->seqControl.seqNumLo)); + auth_node = lim_search_pre_auth_list(pMac, pHdr->sa); + if (auth_node && pHdr->fc.retry && + (auth_node->seq_num == curr_seq_num)) { + pe_err_rl("auth frame, seq num: %d is already processed, drop it", + curr_seq_num); + return eMGMT_DROP_DUPLICATE_AUTH_FRAME; + } } return eMGMT_DROP_NO_DROP;