From 9b755ef5f5687eca5efc072e6360d86775f56281 Mon Sep 17 00:00:00 2001 From: Rajeev Kumar Date: Thu, 14 Apr 2016 15:32:21 -0700 Subject: [PATCH] qcacld-3.0: send correct status code when WEP AUTH fail qcacld-2.0 to qcacld-3.0 propagation With invalid WEP password, some APs reply AUTH frame 4 with invalid seqNumber. This AUTH frame will be dropped by driver, then driver sends the generic status code instead of protocol status code. As a workaround, assign the seqNumber=4 for AUTH frame 4, which ensures driver to send correct status code when WEP AUTH fail. Change-Id: I2fc96f0c253cf639d730d59d567be50bca51bd0b CRs-Fixed: 947898 --- core/mac/src/pe/lim/lim_process_auth_frame.c | 22 ++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/core/mac/src/pe/lim/lim_process_auth_frame.c b/core/mac/src/pe/lim/lim_process_auth_frame.c index 5eb8084520d2..98a8cc113a74 100644 --- a/core/mac/src/pe/lim/lim_process_auth_frame.c +++ b/core/mac/src/pe/lim/lim_process_auth_frame.c @@ -1348,6 +1348,28 @@ lim_process_auth_frame(tpAniSirGlobal mac_ctx, uint8_t *rx_pkt_info, (uint32_t) rx_auth_frm_body->authStatusCode, (uint32_t) mac_ctx->lim.gLimNumPreAuthContexts); + /* + * IOT Workaround: with invalid WEP key, some APs reply + * AuthFrame 4 with invalid seqNumber. This AuthFrame + * will be dropped by driver, thus driver sends the + * generic status code instead of protocol status code. + * As a workaround, override AuthFrame 4's seqNumber. + */ + if ((pe_session->limMlmState == + eLIM_MLM_WT_AUTH_FRAME4_STATE) && + (rx_auth_frm_body->authTransactionSeqNumber != + SIR_MAC_AUTH_FRAME_1) && + (rx_auth_frm_body->authTransactionSeqNumber != + SIR_MAC_AUTH_FRAME_2) && + (rx_auth_frm_body->authTransactionSeqNumber != + SIR_MAC_AUTH_FRAME_3)) { + lim_log(mac_ctx, LOGW, + FL("Override AuthFrame 4's seqNumber to 4.")); + rx_auth_frm_body->authTransactionSeqNumber = + SIR_MAC_AUTH_FRAME_4; + } + + switch (rx_auth_frm_body->authTransactionSeqNumber) { case SIR_MAC_AUTH_FRAME_1: lim_process_auth_frame_type1(mac_ctx,