Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 82d7c12e authored by Bala Venkatesh's avatar Bala Venkatesh Committed by nshrivas
Browse files

qcacmn: 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 supplicant as success.

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

Change-Id: Ia976fee03c77191a7e617a3e21e8c5ddf98759d0
CRs-Fixed: 2412213
parent 41edf921
Loading
Loading
Loading
Loading
+13 −7
Original line number Diff line number Diff line
@@ -901,15 +901,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;
	}