Ver código fonte

qcacld-3.0: Show peer in getTdlsPeers only if STA is associated

qcacld-2.0 to qcacld-3.0 propagation

If the STA is previously associated with AP and has TDLS peers,
then getTdlsPeers will show the peers even after STA is
disassociated.

Thus, the fix is to show the peers only if the STA is in
connected state.

Change-Id: I8686ae3b8bb007b58942cdbd8873e48f227fe443
CRs-Fixed: 2037534
Nitesh Shah 8 anos atrás
pai
commit
621132d764
1 arquivos alterados com 14 adições e 0 exclusões
  1. 14 0
      core/hdd/src/wlan_hdd_tdls.c

+ 14 - 0
core/hdd/src/wlan_hdd_tdls.c

@@ -2478,12 +2478,26 @@ int wlan_hdd_tdls_get_all_peers(hdd_adapter_t *pAdapter, char *buf, int buflen)
 	hddTdlsPeer_t *curr_peer;
 	tdlsCtx_t *pHddTdlsCtx;
 	hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
+	hdd_station_ctx_t *hdd_sta_ctx;
 
 	ENTER();
 
 	if (0 != (wlan_hdd_validate_context(pHddCtx)))
 		return 0;
 
+	if ((QDF_STA_MODE != pAdapter->device_mode)
+	    && (QDF_P2P_CLIENT_MODE != pAdapter->device_mode)) {
+		len = scnprintf(buf, buflen,
+				"\nNo TDLS support for this adapter\n");
+		return len;
+	}
+
+	hdd_sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
+	if (eConnectionState_Associated != hdd_sta_ctx->conn_info.connState) {
+		len = scnprintf(buf, buflen, "\nSTA is not associated\n");
+		return len;
+	}
+
 	init_len = buflen;
 	len = scnprintf(buf, buflen, "\n%-18s%-3s%-4s%-3s%-5s\n",
 			"MAC", "Id", "cap", "up", "RSSI");