From 03b4f0cb344b19989edd8729746d6ab1f85adc78 Mon Sep 17 00:00:00 2001 From: Bala Venkatesh Date: Mon, 28 Jan 2019 22:00:50 +0530 Subject: [PATCH] qcacld-3.0: Delete the pe session only for STA role While processing deuath notification in lim, PE session is deleted without checking the session role. For AP case, if the deauth notification is given to BSSID then also pe session will be deleted and later clean up of the SAP will not be done properly. Hence, for SAP case delete the pe session as part of del bss response only. Here the scenario is SAP's BSSID is blacklisted and acl command is given via IOCTL. This triggered the deauth notification to lim, and pe_session is deleted. Later, the del sta command is failed because del bss has not happened and vdev delete also not done. Hence delete pe session only for sta mode in lim_send_sme_deauth_ntf. And return failure status for iwpriv softap.0 modify_acl command if it is given for SAP's own mac address. Change-Id: I2b394ae8676fe569537b416388a9566f2d35892a CRs-Fixed: 2388404 --- core/mac/src/pe/lim/lim_send_sme_rsp_messages.c | 3 +-- core/sap/src/sap_module.c | 9 ++++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c b/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c index 3ceaecc1449c8..b1056bb77ba61 100644 --- a/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c +++ b/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c @@ -1267,9 +1267,8 @@ lim_send_sme_deauth_ntf(struct mac_context *mac, tSirMacAddr peerMacAddr, } /*Delete the PE session created */ - if (pe_session != NULL) { + if (pe_session && LIM_IS_STA_ROLE(pe_session)) pe_delete_session(mac, pe_session); - } lim_send_sme_disassoc_deauth_ntf(mac, QDF_STATUS_SUCCESS, (uint32_t *) pMsg); diff --git a/core/sap/src/sap_module.c b/core/sap/src/sap_module.c index c8f241b0266ba..d382765c005a0 100644 --- a/core/sap/src/sap_module.c +++ b/core/sap/src/sap_module.c @@ -845,7 +845,14 @@ QDF_STATUS wlansap_modify_acl(struct sap_context *sap_ctx, "%s: Invalid SAP Context", __func__); return QDF_STATUS_E_FAULT; } - + if (qdf_mem_cmp(sap_ctx->bssid.bytes, peer_sta_mac, + QDF_MAC_ADDR_SIZE) == 0) { + QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR, + "requested peer mac is" MAC_ADDRESS_STR + "our own SAP BSSID. Do not blacklist or whitelist this BSSID", + MAC_ADDR_ARRAY(peer_sta_mac)); + return QDF_STATUS_E_FAULT; + } QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_LOW, "Modify ACL entered\n" "Before modification of ACL\n" "size of accept and deny lists %d %d", sap_ctx->nAcceptMac,