diff options
| author | Bala Venkatesh <bjavvaji@codeaurora.org> | 2018-08-13 12:07:39 +0530 |
|---|---|---|
| committer | nshrivas <nshrivas@codeaurora.org> | 2018-08-17 05:58:44 -0700 |
| commit | bd2c1fe0f3e19d2cd418aff0fc47ea38b53bb673 (patch) | |
| tree | d4eb12b8ff27b6c13da3d5caa63065806b78ee56 | |
| parent | f623b766c4631bd44903d6c90976312c68c1c6cd (diff) | |
qcacld-3.0: Check for concurrency in wlan_hdd_tdls_add_station
Currently, in wlan_hdd_tdls_add_station tdls mode is checked if the
state is not enabled, disabled and add station request is rejected.
It can happen in concurrency also tdls mode is enabled and
tdls add sta request is posted to pe and later will result
in add sta req failure.
Instead add explicit check for concurrency in wlan_hdd_tdls_add_station
to avoid posting in the first place.
Change-Id: Ie58542cef92b0589405013b66d368161506542f4
CRs-Fixed: 2297289
| -rw-r--r-- | core/hdd/src/wlan_hdd_tdls.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/core/hdd/src/wlan_hdd_tdls.c b/core/hdd/src/wlan_hdd_tdls.c index 7c7a8a70a9e2..786b6723187f 100644 --- a/core/hdd/src/wlan_hdd_tdls.c +++ b/core/hdd/src/wlan_hdd_tdls.c @@ -3877,6 +3877,7 @@ int wlan_hdd_tdls_add_station(struct wiphy *wiphy, unsigned long rc; int ret; int rate_idx; + hdd_station_ctx_t *hdd_sta_ctx; ENTER(); @@ -3895,6 +3896,26 @@ int wlan_hdd_tdls_add_station(struct wiphy *wiphy, return -ENOTSUPP; } + hdd_sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); + + /* + * STA or P2P client should be connected and authenticated before + * adding TDLS STA. + */ + if ((eConnectionState_Associated != + hdd_sta_ctx->conn_info.connState) || + (false == hdd_sta_ctx->conn_info.uIsAuthenticated)) { + hdd_debug("STA is not connected or not authenticated. connState %u, uIsAuthenticated %u", + hdd_sta_ctx->conn_info.connState, + hdd_sta_ctx->conn_info.uIsAuthenticated); + return -EAGAIN; + } + + if (!cds_check_is_tdls_allowed(pAdapter->device_mode)) { + hdd_debug("TDLS not allowed, reject TDLS add station"); + return -EPERM; + } + mutex_lock(&pHddCtx->tdls_lock); pTdlsPeer = wlan_hdd_tdls_get_peer(pAdapter, mac); |
