Эх сурвалжийг харах

qcacmn: Prevent ML peer creation with duplicate MLD address

This change searches for ML Peer across all MLDs, if ML peer
is found in other MLDs, it will reject MLO peer creation
and rejects association

Change-Id: Ifcb150615d840f536d92734e2ef4f86080f5bb6b
CRs-Fixed: 3425900
Srinivas Pitla 3 жил өмнө
parent
commit
68a9eec276

+ 2 - 1
umac/mlo_mgr/src/wlan_mlo_mgr_ap.c

@@ -456,7 +456,8 @@ void mlo_ap_ml_peerid_free(uint16_t mlo_peer_id)
 		return;
 	}
 
-	if (mlo_peer_id > mlo_ctx->max_mlo_peer_id) {
+	if ((mlo_peer_id > mlo_ctx->max_mlo_peer_id) ||
+	    (mlo_peer_id > MAX_MLO_PEER_ID)) {
 		mlo_err(" ML peer id %d is invalid", mlo_peer_id);
 		QDF_BUG(0);
 		return;

+ 19 - 0
umac/mlo_mgr/src/wlan_mlo_mgr_peer.c

@@ -1173,6 +1173,25 @@ QDF_STATUS wlan_mlo_peer_create(struct wlan_objmgr_vdev *vdev,
 	if ((wlan_vdev_mlme_get_opmode(vdev) == QDF_SAP_MODE) ||
 		((wlan_vdev_mlme_get_opmode(vdev) == QDF_STA_MODE) &&
 			!is_ml_peer_attached)) {
+		/* Reject creation for AP mode, If ML peer is present with
+		 * MLD MAC address, For PSTA case, all MLD STAs are connected
+		 * to same MLD AP, it can have duplicate MLD address entries
+		 * for STA MLDs
+		 */
+		if ((wlan_vdev_mlme_get_opmode(vdev) == QDF_SAP_MODE) &&
+		    mlo_mgr_ml_peer_exist_on_diff_ml_ctx(&link_peer->mldaddr[0],
+							 NULL)) {
+			mlo_reset_link_peer(ml_peer, link_peer);
+			mlo_peer_free(ml_peer);
+			mlo_dev_release_link_vdevs(link_vdevs);
+			wlan_objmgr_peer_release_ref(link_peer,
+						     WLAN_MLO_MGR_ID);
+			mlo_err("MLD ID %d ML Peer " QDF_MAC_ADDR_FMT " is exists, creation failed",
+				ml_dev->mld_id,
+				QDF_MAC_ADDR_REF(ml_peer->peer_mld_addr.bytes));
+			return QDF_STATUS_E_EXISTS;
+		}
+
 		/* Attach MLO peer to ML Peer table */
 		status = mlo_dev_mlpeer_attach(ml_dev, ml_peer);
 		if (status != QDF_STATUS_SUCCESS) {