Przeglądaj źródła

qcacmn: Fix wlan_crypto_setkey to set ucast key for correct macaddr

Ucast key was not being set for correct peer macaddr.
Changed key flags for bcast to include WLAN_CRYPTO_KEY_GROUP
and set keys for correct peer.

Change-Id: I6859dc837ee6678dc11f9aadbb2a6bc0d0e9885f
Nandha Kishore Easwaran 7 lat temu
rodzic
commit
786c9550d6

+ 2 - 15
umac/cmn_services/crypto/src/wlan_crypto_global_api.c

@@ -343,7 +343,8 @@ QDF_STATUS wlan_crypto_setkey(struct wlan_objmgr_vdev *vdev,
 
 		req_key->flags |= (WLAN_CRYPTO_KEY_XMIT
 					| WLAN_CRYPTO_KEY_RECV);
-		req_key->flags |= WLAN_CRYPTO_KEY_GROUP;
+		if (isbcast)
+			req_key->flags |= WLAN_CRYPTO_KEY_GROUP;
 	}
 
 	vdev_mode = wlan_vdev_mlme_get_opmode(vdev);
@@ -384,20 +385,6 @@ QDF_STATUS wlan_crypto_setkey(struct wlan_objmgr_vdev *vdev,
 			}
 			key = crypto_priv->key[req_key->keyix];
 		}
-		if (vdev_mode == QDF_STA_MODE) {
-			peer = wlan_vdev_get_bsspeer(vdev);
-			if (!peer) {
-				qdf_print("%s[%d] peer is null\n",
-							__func__, __LINE__);
-				return QDF_STATUS_E_INVAL;
-			}
-			wlan_objmgr_peer_try_get_ref(peer, WLAN_CRYPTO_ID);
-			wlan_peer_obj_lock(peer);
-			qdf_mem_copy(macaddr, wlan_peer_get_macaddr(peer),
-						WLAN_ALEN);
-			wlan_peer_obj_unlock(peer);
-			wlan_objmgr_peer_release_ref(peer, WLAN_CRYPTO_ID);
-		}
 	} else {
 		peer = wlan_objmgr_get_peer_by_mac_n_vdev(
 					psoc,