Explorar el Código

qcacld-3.0: Avoid TDLS entry with MAC same as existing non-TDLS peer

In lim_tdls_setup_add_sta() even if a pStaDs is already present and
is a non TDLS peer, the driver proceed assuming it as TDLS peer and
update its type and states.

Now when driver tries to delete this non TDLS peer, as its states
and type are modified it fails to properly clean up the peer.

Fix it by allowing only TDLS entry to be updated. Also ignore if a
entry is already present and the operation is TDLS add.

Change-Id: I65fc73d65cdf768fd5b8afd050ca7314fd55c9ff
CRs-Fixed: 2200498
Abhishek Singh hace 7 años
padre
commit
3ed00d11ba
Se han modificado 1 ficheros con 13 adiciones y 0 borrados
  1. 13 0
      core/mac/src/pe/lim/lim_process_tdls.c

+ 13 - 0
core/mac/src/pe/lim/lim_process_tdls.c

@@ -2560,6 +2560,19 @@ static tSirRetStatus lim_tdls_setup_add_sta(tpAniSirGlobal pMac,
 
 	pStaDs = dph_lookup_hash_entry(pMac, pAddStaReq->peermac.bytes, &aid,
 				       &psessionEntry->dph.dphHashTable);
+
+	if (pStaDs && pAddStaReq->tdlsAddOper == TDLS_OPER_ADD) {
+		pe_err("TDLS entry for peer: "MAC_ADDRESS_STR " already exist, cannot add new entry",
+			MAC_ADDR_ARRAY(pAddStaReq->peermac.bytes));
+			return eSIR_FAILURE;
+	}
+
+	if (pStaDs && pStaDs->staType != STA_ENTRY_TDLS_PEER) {
+		pe_err("Non TDLS entry for peer: "MAC_ADDRESS_STR " already exist",
+			MAC_ADDR_ARRAY(pAddStaReq->peermac.bytes));
+			return eSIR_FAILURE;
+	}
+
 	if (NULL == pStaDs) {
 		aid = lim_assign_peer_idx(pMac, psessionEntry);