浏览代码

qcacmn: Remove crypto keys in case of reset

Currently, host driver removes crypto keys based
on pdev create or delete. But these keys are not
valid across connections. So, free the crypto keys
upon new candidate selection/new connect request.

This change is to free crypto keys if there is new
candidate selection or another connection request.

Change-Id: Ifaa8786efab09f6b753a6355f249ccb3018da097
CRs-Fixed: 3568173
Aasir Rasheed 1 年之前
父节点
当前提交
7dc944d192
共有 1 个文件被更改,包括 16 次插入1 次删除
  1. 16 1
      umac/mlo_mgr/src/wlan_mlo_mgr_link_switch.c

+ 16 - 1
umac/mlo_mgr/src/wlan_mlo_mgr_link_switch.c

@@ -22,6 +22,7 @@
 #include <wlan_mlo_mgr_sta.h>
 #include <wlan_serialization_api.h>
 #include <wlan_cm_api.h>
+#include <wlan_crypto_def_i.h>
 
 void mlo_mgr_update_link_info_mac_addr(struct wlan_objmgr_vdev *vdev,
 				       struct wlan_mlo_link_mac_update *ml_mac_update)
@@ -134,13 +135,27 @@ void mlo_mgr_reset_ap_link_info(struct wlan_objmgr_vdev *vdev)
 {
 	struct mlo_link_info *link_info;
 	uint8_t link_info_iter;
+	struct wlan_objmgr_psoc *psoc;
 
 	if (!vdev || !vdev->mlo_dev_ctx)
 		return;
 
+	psoc = wlan_vdev_get_psoc(vdev);
+	if (!psoc) {
+		mlo_err("psoc NULL");
+		return;
+	}
+
 	link_info = &vdev->mlo_dev_ctx->link_ctx->links_info[0];
 
-	for (link_info_iter = 0; link_info_iter < 3; link_info_iter++) {
+	for (link_info_iter = 0; link_info_iter < WLAN_MAX_ML_BSS_LINKS;
+	     link_info_iter++) {
+		if (!qdf_is_macaddr_zero(&link_info->ap_link_addr) &&
+		    !qdf_is_macaddr_zero(&link_info->link_addr))
+			wlan_crypto_free_key_by_link_id(
+						psoc,
+						&link_info->link_addr,
+						link_info->link_id);
 		qdf_mem_zero(&link_info->ap_link_addr, QDF_MAC_ADDR_SIZE);
 		qdf_mem_zero(link_info->link_chan_info,
 			     sizeof(*link_info->link_chan_info));