Pārlūkot izejas kodu

qcacmn: Fix P2P find failure for invalid RSN probe response

Some p2p device include invalid RSN IE in wildcard probe respone
frames in p2p discovery. Do not drop it because the wildcard
SSID entry will not be used to do association.

Change-Id: I1e390509931094d9d9a55d2caef825c5772a086b
CRs-Fixed: 3282030
Liangwei Dong 2 gadi atpakaļ
vecāks
revīzija
bf0b0fed9a
1 mainītis faili ar 23 papildinājumiem un 1 dzēšanām
  1. 23 1
      umac/scan/core/src/wlan_scan_cache_db.c

+ 23 - 1
umac/scan/core/src/wlan_scan_cache_db.c

@@ -1017,6 +1017,27 @@ static bool scm_is_bss_allowed_for_country(struct wlan_objmgr_psoc *psoc,
 }
 #endif
 
+/**
+ * scm_is_p2p_wildcard_ssid() - check p2p wildcard ssid or not
+ * @scan_entry: scan entry
+ *
+ * Return: true if SSID is wildcard "DIRECT-" ssid
+ */
+static bool scm_is_p2p_wildcard_ssid(struct scan_cache_entry *scan_entry)
+{
+	static const char wildcard_ssid[] = "DIRECT-";
+	uint8_t len = sizeof(wildcard_ssid) - 1;
+
+	if (!scan_entry->is_p2p)
+		return false;
+	if (!qdf_mem_cmp(scan_entry->ssid.ssid,
+			 wildcard_ssid, len) &&
+	    (scan_entry->ssid.length == len))
+		return true;
+
+	return false;
+}
+
 QDF_STATUS __scm_handle_bcn_probe(struct scan_bcn_probe_event *bcn)
 {
 	struct wlan_objmgr_psoc *psoc;
@@ -1131,7 +1152,8 @@ QDF_STATUS __scm_handle_bcn_probe(struct scan_bcn_probe_event *bcn)
 			status = wlan_crypto_rsnie_check(
 					&sec_params,
 					util_scan_entry_rsn(scan_entry));
-			if (QDF_IS_STATUS_ERROR(status)) {
+			if (QDF_IS_STATUS_ERROR(status) &&
+			    !scm_is_p2p_wildcard_ssid(scan_entry)) {
 				scm_nofl_debug("Drop frame from invalid RSN IE AP"
 					       QDF_MAC_ADDR_FMT
 					       ": RSN IE parse failed, status %d",