Browse Source

qcacld-3.0: Skip invalid peer deauth for valid STA

In current design, deauth will be sent for invalid rx
indication since it is expected only for unassociated
STA. However, if due to some rxdma errors, invalid rx
indication is received for an associated STA, then SM
cleanup for the associated STA would not happen after
the deauth. This stale SM entries causes association
failures during the next connection attempt from STA.

Fix this by preventing the deauth for the associated
STA on receiving a invalid peer indication.

Change-Id: I25cbc578ba76e74120e975f142334ff0fd931a6a
CRs-Fixed: 3359541
Surya Prakash Sivaraj 2 years ago
parent
commit
1364e17d1a
1 changed files with 20 additions and 1 deletions
  1. 20 1
      core/mac/src/pe/lim/lim_link_monitoring_algo.c

+ 20 - 1
core/mac/src/pe/lim/lim_link_monitoring_algo.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -528,6 +528,8 @@ void lim_rx_invalid_peer_process(struct mac_context *mac_ctx,
 			(struct ol_rx_inv_peer_params *)lim_msg->bodyptr;
 	struct pe_session *session_entry;
 	uint16_t reason_code = REASON_CLASS3_FRAME_FROM_NON_ASSOC_STA;
+	uint16_t aid;
+	tpDphHashNode sta_ds;
 
 	if (!msg) {
 		pe_err("Invalid body pointer in message");
@@ -543,6 +545,23 @@ void lim_rx_invalid_peer_process(struct mac_context *mac_ctx,
 
 	/* only if SAP mode */
 	if (session_entry->bssType == eSIR_INFRA_AP_MODE) {
+		sta_ds = dph_lookup_hash_entry(mac_ctx, msg->ta, &aid,
+					       &session_entry->dph.dphHashTable);
+		if (sta_ds && sta_ds->is_key_installed) {
+			/*
+			 * Skip deauth for an associated STA.
+			 *
+			 * The deauth sent for invalid peer indication will
+			 * not cleanup the SM if this is an associated STA.
+			 * Therefore, the deauth for associated STA creates
+			 * stale entries even after STA gets disconnected.
+			 */
+			pe_err_rl("Received Invalid rx peer indication for an associated STA "
+			       QDF_MAC_ADDR_FMT, QDF_MAC_ADDR_REF(msg->ta));
+			qdf_mem_free(msg);
+			lim_msg->bodyptr = NULL;
+			return;
+		}
 		pe_debug("send deauth frame to non-assoc STA");
 		lim_send_deauth_mgmt_frame(mac_ctx,
 					   reason_code,