P2P: optimize join scan freq
If the auto GO has been discovered on another interface, optimize scan
frequency by performing a single channel scan first.
Bug: 233925359
Test: Configured auto GO using the WifiP2pTest app, used wifi picker to
discover the GO on client device, enabled client on WifiP2PTest app and
looked at logs to confirm that only operating freq was scanned
Change-Id: Iff9b67093647b829cc00a4afbb1f016a3a6de37b
diff --git a/wpa_supplicant/bss.c b/wpa_supplicant/bss.c
index a3da86c..dcc28be 100644
--- a/wpa_supplicant/bss.c
+++ b/wpa_supplicant/bss.c
@@ -240,7 +240,7 @@
/**
* wpa_bss_get - Fetch a BSS table entry based on BSSID and SSID
* @wpa_s: Pointer to wpa_supplicant data
- * @bssid: BSSID
+ * @bssid: BSSID, or %NULL to match any BSSID
* @ssid: SSID
* @ssid_len: Length of @ssid
* Returns: Pointer to the BSS entry or %NULL if not found
@@ -252,7 +252,8 @@
if (!wpa_supplicant_filter_bssid_match(wpa_s, bssid))
return NULL;
dl_list_for_each(bss, &wpa_s->bss, struct wpa_bss, list) {
- if (os_memcmp(bss->bssid, bssid, ETH_ALEN) == 0 &&
+ if ((!bssid ||
+ os_memcmp(bss->bssid, bssid, ETH_ALEN) == 0) &&
bss->ssid_len == ssid_len &&
os_memcmp(bss->ssid, ssid, ssid_len) == 0)
return bss;