From fc2f06074b7799acc7e96e2dff7f5dc1eefdd234 Mon Sep 17 00:00:00 2001 From: Pradeep Reddy POTTETI Date: Wed, 30 Mar 2016 17:49:44 +0530 Subject: TDLS: Don't delete TDLS forced peers as part of STA disconnection Don't delete TDLS forced peers as part of STA disconnection. TDLS forced peer entry should exist until there is a explicit deconfig from the application. CRs-Fixed: 993297 Change-Id: Ie1bb6bc92849182b82e01e5b5237cead1538f4d7 --- CORE/HDD/src/wlan_hdd_tdls.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/CORE/HDD/src/wlan_hdd_tdls.c b/CORE/HDD/src/wlan_hdd_tdls.c index 155e0bee4de2..44a51bffb183 100644 --- a/CORE/HDD/src/wlan_hdd_tdls.c +++ b/CORE/HDD/src/wlan_hdd_tdls.c @@ -414,7 +414,8 @@ static v_VOID_t wlan_hdd_tdls_discovery_timeout_peer_cb(v_PVOID_t userData) return; } -static void wlan_hdd_tdls_free_list(tdlsCtx_t *pHddTdlsCtx) +static void wlan_hdd_tdls_free_list(tdlsCtx_t *pHddTdlsCtx, + bool del_forced_peer) { int i; struct list_head *head; @@ -432,6 +433,9 @@ static void wlan_hdd_tdls_free_list(tdlsCtx_t *pHddTdlsCtx) head = &pHddTdlsCtx->peer_list[i]; list_for_each_safe (pos, q, head) { tmp = list_entry(pos, hddTdlsPeer_t, node); + /* Don't delete TDLS forced peers during STA disconnection */ + if (!del_forced_peer && tmp->isForcedPeer) + continue; list_del(pos); vos_mem_free(tmp); tmp = NULL; @@ -800,7 +804,7 @@ void wlan_hdd_tdls_exit(hdd_adapter_t *pAdapter) /* must stop timer here before freeing peer list, because peerIdleTimer is part of peer list structure. */ wlan_hdd_tdls_timers_destroy(pHddTdlsCtx); - wlan_hdd_tdls_free_list(pHddTdlsCtx); + wlan_hdd_tdls_free_list(pHddTdlsCtx, true); mutex_unlock(&pHddCtx->tdls_lock); @@ -2181,7 +2185,7 @@ void wlan_hdd_tdls_disconnection_callback(hdd_adapter_t *pAdapter) wlan_hdd_tdls_check_power_save_prohibited(pHddTdlsCtx->pAdapter); wlan_hdd_tdls_monitor_timers_stop(pHddTdlsCtx); - wlan_hdd_tdls_free_list(pHddTdlsCtx); + wlan_hdd_tdls_free_list(pHddTdlsCtx, false); pHddTdlsCtx->curr_candidate = NULL; -- cgit v1.2.3