Selaa lähdekoodia

qcacld-3.0: Reject reassoc to AP that connected on other vdev

In Dual station case, reassociate to AP which is connected on other
vdev is not supported, and will get roam invoke failure from target.
Disallow the bssid reassocaite by checking the connected vdev.

Change-Id: I4533cf8b633cec9ddebff946248dbacf8eab169d
CRs-Fixed: 2868221
Liangwei Dong 4 vuotta sitten
vanhempi
sitoutus
34cdb77ca8
1 muutettua tiedostoa jossa 9 lisäystä ja 0 poistoa
  1. 9 0
      core/hdd/src/wlan_hdd_ioctl.c

+ 9 - 0
core/hdd/src/wlan_hdd_ioctl.c

@@ -574,6 +574,7 @@ int hdd_reassoc(struct hdd_adapter *adapter, const uint8_t *bssid,
 	struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
 	int ret = 0;
 	QDF_STATUS status;
+	uint8_t connected_vdev;
 
 	if (!hdd_ctx) {
 		hdd_err("Invalid hdd ctx");
@@ -622,6 +623,14 @@ int hdd_reassoc(struct hdd_adapter *adapter, const uint8_t *bssid,
 		ret = -EINVAL;
 		goto exit;
 	}
+	if (wlan_get_connected_vdev_by_bssid(hdd_ctx->pdev, (uint8_t *)bssid,
+					     &connected_vdev) &&
+	    connected_vdev != adapter->vdev_id) {
+		hdd_err("bssid "QDF_MAC_ADDR_FMT" connected by other vdev %d",
+			QDF_MAC_ADDR_REF(bssid), connected_vdev);
+		ret = -EPERM;
+		goto exit;
+	}
 
 	/* Proceed with reassoc */
 	if (roaming_offload_enabled(hdd_ctx)) {