Browse Source

qcacld-3.0: Trigger join failure on assoc/reassoc bssid mismatch

Currently, during assoc/reassoc frame handling current/limReAssocbssId
is compared with source address and if it doesn't match beacon gets freed
but the issue is cm state will be in connecting state as host doesn't
changing state, so scan will be paused when state is connecting.

Fix is to send join failure when bssid mismatch happens.

Change-Id: Ibe66afd31d7fc0d869c7a380a4a25dc06a2e9b62
CRs-Fixed: 3621011
Sheenam Monga 1 year ago
parent
commit
054d155075
1 changed files with 39 additions and 0 deletions
  1. 39 0
      core/mac/src/pe/lim/lim_process_assoc_rsp_frame.c

+ 39 - 0
core/mac/src/pe/lim/lim_process_assoc_rsp_frame.c

@@ -1050,6 +1050,31 @@ static inline void lim_cache_emlsr_params(struct pe_session *session_entry,
 }
 #endif
 
+/**
+ * lim_send_join_fail() - Send join failure
+ * @mac_ctx: Pointer to Global MAC structure
+ * @session_entry: Session entry
+ * @result_code: result code to send in join result
+ *
+ * This function sends join failure when bssid of assoc/reassoc
+ * resp doesn't match with current bssid
+ */
+static
+void lim_send_join_fail(struct mac_context *mac_ctx,
+			struct pe_session *session_entry,
+			enum eSirResultCodes result_code)
+{
+	session_entry->limSmeState = eLIM_SME_JOIN_FAILURE_STATE;
+	MTRACE(mac_trace(mac_ctx, TRACE_CODE_SME_STATE,
+			 session_entry->peSessionId,
+			 session_entry->limSmeState));
+
+	/* Send Join response to Host */
+	lim_handle_sme_join_result(
+			mac_ctx, result_code, STATUS_UNSPECIFIED_FAILURE,
+			session_entry);
+}
+
 /**
  * lim_process_assoc_rsp_frame() - Processes assoc response
  * @mac_ctx: Pointer to Global MAC structure
@@ -1057,6 +1082,7 @@ static inline void lim_cache_emlsr_params(struct pe_session *session_entry,
  * @frame_body_length - frame body length of reassoc/assoc response frame
  * @sub_type - Indicates whether it is Association Response (=0) or
  *                   Reassociation Response (=1) frame
+ * @session_entry: Session entry
  *
  * This function is called by limProcessMessageQueue() upon
  * Re/Association Response frame reception.
@@ -1159,6 +1185,13 @@ lim_process_assoc_rsp_frame(struct mac_context *mac_ctx, uint8_t *rx_pkt_info,
 			 */
 			pe_warn("received AssocRsp from unexpected peer "QDF_MAC_ADDR_FMT,
 				QDF_MAC_ADDR_REF(hdr->sa));
+			/*
+			 * Send Assoc failure to avoid connection in
+			 * progress state.
+			 */
+
+			lim_send_join_fail(mac_ctx, session_entry,
+					   eSIR_SME_ASSOC_REFUSED);
 			qdf_mem_free(beacon);
 			return;
 		}
@@ -1173,6 +1206,12 @@ lim_process_assoc_rsp_frame(struct mac_context *mac_ctx, uint8_t *rx_pkt_info,
 			 */
 			pe_warn("received ReassocRsp from unexpected peer "QDF_MAC_ADDR_FMT,
 				QDF_MAC_ADDR_REF(hdr->sa));
+			/*
+			 * Send Reassoc failure to avoid connection in
+			 * progress state.
+			 */
+			lim_send_join_fail(mac_ctx, session_entry,
+					   eSIR_SME_REASSOC_REFUSED);
 			qdf_mem_free(beacon);
 			return;
 		}