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
This commit is contained in:
Bala Venkatesh
2019-03-06 18:55:34 +05:30
committed by nshrivas
parent 7e36dedeaa
commit 1ca2be1c00

View File

@@ -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 */ /* 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_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, QDF_MAC_ADDR_ARRAY(mac), curr_peer->link_status,
curr_peer->sta_id, curr_peer->sta_id);
(TDLS_STA_INDEX_CHECK(curr_peer->sta_id)) ? "ignored" status = QDF_STATUS_E_PERM;
: "declined"); goto updatersp;
status = (TDLS_STA_INDEX_CHECK(curr_peer->sta_id)) ? }
QDF_STATUS_SUCCESS : QDF_STATUS_E_PERM;
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; goto updatersp;
} }