Ver Fonte

qcacld-3.0: Check the RA of the mgmt frame for ML SAP BSS

If EAPOL exchange fails for the any ML client connecting to ML SAP,
the deauth frame is sent with MLD address of the respective client.
This can lead to peer look up while preparing deauth frame and will
drop sending deauth frame.

For ML SAP session, if the peer address received is MLD address,
then change the address to primary link's address of the peer.

Change-Id: Ic23cbdfd60672432347e0837b059aea663a9c510
CRs-Fixed: 3357351
Vinod Kumar Pirla há 2 anos atrás
pai
commit
85d2d11666
1 ficheiros alterados com 74 adições e 0 exclusões
  1. 74 0
      core/mac/src/pe/lim/lim_process_sme_req_messages.c

+ 74 - 0
core/mac/src/pe/lim/lim_process_sme_req_messages.c

@@ -71,6 +71,9 @@
 #include "wlan_twt_cfg_ext_api.h"
 #include <spatial_reuse_api.h>
 #include "wlan_psoc_mlme_api.h"
+#ifdef WLAN_FEATURE_11BE_MLO
+#include <wlan_mlo_mgr_peer.h>
+#endif
 
 /* SME REQ processing function templates */
 static bool __lim_process_sme_sys_ready_ind(struct mac_context *, uint32_t *);
@@ -111,6 +114,8 @@ static void lim_process_update_add_ies(struct mac_context *mac, uint32_t *pMsg);
 static void lim_process_ext_change_channel(struct mac_context *mac_ctx,
 						uint32_t *msg);
 
+static void lim_mlo_sap_validate_and_update_ra(struct pe_session *session,
+					       struct qdf_mac_addr *peer_addr);
 /**
  * enum get_next_lower_bw - Get next higher bandwidth for a given BW.
  * This enum is used in conjunction with
@@ -5701,6 +5706,59 @@ void lim_calculate_tpc(struct mac_context *mac,
 		 num_pwr_levels, is_psd_power, reg_max, ap_power_type_6g);
 }
 
+/**
+ * lim_mlo_sap_validate_and_update_ra() - Validate peer address for ML SAP
+ * management frames.
+ * @session: pe_session
+ * @peer_addr: address of the peer
+ *
+ * Check if address pointed by @peer_addr is MLD of the client,
+ * if so, replace the address with link address of the client
+ * to send the management packet over the air.
+ *
+ * Return: void
+ */
+#ifdef WLAN_FEATURE_11BE_MLO
+static void lim_mlo_sap_validate_and_update_ra(struct pe_session *session,
+					       struct qdf_mac_addr *peer_addr)
+{
+	uint8_t i;
+	struct wlan_mlo_dev_context *ml_ctx;
+	struct wlan_mlo_peer_list *mlo_peer_list;
+	struct wlan_mlo_peer_context *ml_peer;
+	struct wlan_mlo_link_peer_entry *link_peer;
+
+	if (!wlan_vdev_mlme_is_mlo_ap(session->vdev))
+		return;
+
+	ml_ctx = session->vdev->mlo_dev_ctx;
+	mlo_peer_list = &ml_ctx->mlo_peer_list;
+
+	ml_peerlist_lock_acquire(mlo_peer_list);
+	ml_peer = mlo_get_mlpeer(ml_ctx, peer_addr);
+	if (!ml_peer) {
+		ml_peerlist_lock_release(mlo_peer_list);
+		return;
+	}
+
+	for (i = 0; i < MAX_MLO_LINK_PEERS; i++) {
+		link_peer = &ml_peer->peer_list[i];
+		if (link_peer->is_primary &&
+		    !qdf_is_macaddr_equal(peer_addr, &link_peer->link_addr)) {
+			qdf_copy_macaddr(peer_addr, &link_peer->link_addr);
+			break;
+		}
+	}
+	ml_peerlist_lock_release(mlo_peer_list);
+}
+#else
+static inline void
+lim_mlo_sap_validate_and_update_ra(struct pe_session *session,
+				   struct qdf_mac_addr *peer_addr)
+{
+}
+#endif
+
 bool send_disassoc_frame = 1;
 /**
  * __lim_process_sme_disassoc_req()
@@ -5855,6 +5913,11 @@ static void __lim_process_sme_disassoc_req(struct mac_context *mac,
 		break;
 
 	case eLIM_AP_ROLE:
+		/* Check if MAC address is MLD of the client and
+		 * change it to primary link address to send OTA.
+		 */
+		lim_mlo_sap_validate_and_update_ra(
+				pe_session, &smeDisassocReq.peer_macaddr);
 		break;
 
 	default:
@@ -6203,6 +6266,11 @@ static void __lim_process_sme_deauth_req(struct mac_context *mac_ctx,
 		}
 		break;
 	case eLIM_AP_ROLE:
+		/* Check if MAC address is MLD of the client and
+		 * change it to primary link address to send OTA.
+		 */
+		lim_mlo_sap_validate_and_update_ra(
+				session_entry, &sme_deauth_req.peer_macaddr);
 		break;
 	default:
 		pe_err("received unexpected SME_DEAUTH_REQ for role %X",
@@ -7766,6 +7834,12 @@ static void __lim_process_send_disassoc_frame(struct mac_context *mac_ctx,
 		return;
 	}
 
+	/* Check if MAC address is MLD of the client and
+	 * change it to primary link address to send OTA.
+	 */
+	lim_mlo_sap_validate_and_update_ra(
+			session_entry, (struct qdf_mac_addr *)req->peer_mac);
+
 	pe_debug("msg_type %d len %d vdev_id %d mac: " QDF_MAC_ADDR_FMT " reason %d wait_for_ack %d",
 		 req->msg_type, req->length,  req->vdev_id,
 		 QDF_MAC_ADDR_REF(req->peer_mac), req->reason, req->wait_for_ack);