From ec14e6a53bfd8cd7fbbc0400d3ed2ab871e8ac4b Mon Sep 17 00:00:00 2001 From: "Konamki, Sreelakshmi" Date: Wed, 15 Jul 2015 12:43:29 +0530 Subject: [PATCH] qcacld-3.0: STA is disconnected with specific AP IPTIME N904NS-second qcacld-2.0 to qcacld-3.0 propagation STA gets disconnected with AP IPTIME N904NS when AP is configured for WPA1 + TKIP on CH 161. Return value of memcmp function must be checked with NOT operation. Change-Id: Ic866a70917c1e713855c28a8f156ffe7c381fa07 CRs-Fixed: 642070 --- core/sme/src/csr/csr_api_roam.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index faf9b032fc7d..d4c39e4ef4b2 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -12075,16 +12075,16 @@ static ePhyChanBondState csr_get_cb_mode_from_ies(tpAniSirGlobal pMac, return PHY_SINGLE_CHANNEL_CENTERED; } - /* Check set as TKIP or not. */ - if (((NULL != &(pIes->RSN.pwise_cipher_suites[0][0]) && - (pIes->RSN.pwise_cipher_suite_count == 1)) && + /* In Case WPA2 and TKIP is the only one cipher suite in Pairwise */ + if ((pIes->RSN.present && (pIes->RSN.pwise_cipher_suite_count == 1) && !memcmp(&(pIes->RSN.pwise_cipher_suites[0][0]), - "\x00\x0f\xac\x02", 4)) - || (((NULL != &(pIes->WPA)) && - (pIes->WPA.unicast_cipher_count == 1)) - && ((NULL != &(pIes->WPA.unicast_ciphers[0])) - && !memcmp(&(pIes->WPA.unicast_ciphers[0]), - "\x00\x50\xf2\x02", 4)))) { + "\x00\x0f\xac\x02", 4)) + /* In Case WPA1 and TKIP is the only one cipher suite + * in Unicast. + */ + || (pIes->WPA.present && (pIes->WPA.unicast_cipher_count == 1) + && !memcmp(&(pIes->WPA.unicast_ciphers[0][0]), + "\x00\x50\xf2\x02", 4))) { sms_log(pMac, LOGW, " No channel bonding in TKIP mode "); return PHY_SINGLE_CHANNEL_CENTERED;