From 3fb55f01e4072d5365889cc81d61d0cf3a108c6d Mon Sep 17 00:00:00 2001 From: Utkarsh Bhatnagar Date: Wed, 9 Sep 2020 16:45:41 +0530 Subject: [PATCH] qcacld-3.0: Update peer if add TDLS is rejected in of case ongoing setup In case two clients try to establish the TDLS connection simultaneously, the peer who is able to transmit the setup request first will be connected and the other request is in driver without notifying the peer. This causes peer to get stuck waiting for the TDLS setup response. So, send TDLS setup response with unspecified failure reason code, ift here is already TDLS setup. Also, drop the setup response only if status code is zero in case setup is already in progress. This way if the status code is set which will be set in tdls_activate_add_peer(), in case of request already in process, the same error code can be notified to the peer. Change-Id: I83fea4586d6e344a86a9185b078e4d87ec38c664 CRs-Fixed: 2771973 --- components/tdls/core/src/wlan_tdls_cmds_process.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/components/tdls/core/src/wlan_tdls_cmds_process.c b/components/tdls/core/src/wlan_tdls_cmds_process.c index c98f227f063e..db6f536b61b9 100644 --- a/components/tdls/core/src/wlan_tdls_cmds_process.c +++ b/components/tdls/core/src/wlan_tdls_cmds_process.c @@ -709,10 +709,16 @@ int tdls_validate_mgmt_request(struct tdls_action_frame_request *tdls_mgmt_req) return -EAGAIN; } } - + /* + * In case another tdls request comes while tdls setup is already + * ongoing with one peer. Reject only when status code is 0. If status + * code is non-zero, it means supplicant already rejected it and + * the same should be notified to peer. + */ if (TDLS_IS_SETUP_ACTION(tdls_validate->action_code)) { - if (tdls_is_progress(tdls_vdev, - tdls_validate->peer_mac, true)) { + if (tdls_is_progress(tdls_vdev, tdls_validate->peer_mac, + true) && + tdls_validate->status_code == 0) { tdls_err("setup is ongoing. action %d declined for " QDF_MAC_ADDR_FMT, tdls_validate->action_code,