Browse Source

qcacld-3.0: Fix return status in tdls_activate_update_peer

If the curr_peer link status is tearing or connected,
activate peer cmd is rejected and the return status is sent
to supplcant as success even.

But return failure status to supplicant if the link is tearing.

Change-Id: Ia976fee03c77191a7e617a3e21e8c5ddf98759d0
CRs-Fixed: 2411146
Bala Venkatesh 6 năm trước cách đây
mục cha
commit
d3e6927926
1 tập tin đã thay đổi với 13 bổ sung7 xóa
  1. 13 7
      tdls/core/src/wlan_tdls_cmds_process.c

+ 13 - 7
tdls/core/src/wlan_tdls_cmds_process.c

@@ -908,15 +908,21 @@ tdls_activate_update_peer(struct tdls_update_peer_request *req)
 	}
 
 	/* in change station, we accept only when sta_id is valid */
-	if (curr_peer->link_status > TDLS_LINK_CONNECTING ||
+	if (curr_peer->link_status ==  TDLS_LINK_TEARING ||
 	    !(TDLS_STA_INDEX_CHECK(curr_peer->sta_id))) {
-		tdls_err(QDF_MAC_ADDR_STR " link %d. sta %d. update peer %s",
+		tdls_err(QDF_MAC_ADDR_STR " link %d. sta %d. update peer rejected",
 			 QDF_MAC_ADDR_ARRAY(mac), curr_peer->link_status,
-			 curr_peer->sta_id,
-			 (TDLS_STA_INDEX_CHECK(curr_peer->sta_id)) ? "ignored"
-			 : "declined");
-		status = (TDLS_STA_INDEX_CHECK(curr_peer->sta_id)) ?
-			QDF_STATUS_SUCCESS : QDF_STATUS_E_PERM;
+			 curr_peer->sta_id);
+		status = QDF_STATUS_E_PERM;
+		goto updatersp;
+	}
+
+	if (curr_peer->link_status ==  TDLS_LINK_CONNECTED &&
+	    TDLS_STA_INDEX_CHECK(curr_peer->sta_id)) {
+		tdls_err(QDF_MAC_ADDR_STR " link %d. sta %d. update peer is igonored as tdls state is already connected ",
+			 QDF_MAC_ADDR_ARRAY(mac), curr_peer->link_status,
+			 curr_peer->sta_id);
+		status = QDF_STATUS_SUCCESS;
 		goto updatersp;
 	}