aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2019-03-10 04:49:32 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2019-03-10 04:49:32 +0000
commit8b0b5ed2aaa7e8572c4d30b3f66e34bd136e444d (patch)
treef645d2c0375026ccfa530d88a8e7b0cd4c5b7f71
parent4a448e47fe3e30c078e5ebdbdd27dc608e67b2f8 (diff)
parent77b484155ce9d7a11c820a7db1d02ba8c7fde8e6 (diff)
downloadwpa_supplicant_8-8b0b5ed2aaa7e8572c4d30b3f66e34bd136e444d.tar.gz
Merge "p2p: change wildcard mac address to 02:00:00:00:00:00"
-rw-r--r--wpa_supplicant/hidl/1.2/p2p_iface.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/wpa_supplicant/hidl/1.2/p2p_iface.cpp b/wpa_supplicant/hidl/1.2/p2p_iface.cpp
index 56f83442..dba66646 100644
--- a/wpa_supplicant/hidl/1.2/p2p_iface.cpp
+++ b/wpa_supplicant/hidl/1.2/p2p_iface.cpp
@@ -115,11 +115,20 @@ void setBandScanFreqsList(
params->freqs[count++] = mode->channels[i].freq;
}
}
+/*
+ * isAnyEtherAddr - match any ether address
+ *
+ */
+int isAnyEtherAddr(const u8 *a)
+{
+ // 02:00:00:00:00:00
+ return (a[0] == 2) && !(a[1] | a[2] | a[3] | a[4] | a[5]);
+}
/**
* findBssBySsid - Fetch a BSS table entry based on SSID and optional BSSID.
* @wpa_s: Pointer to wpa_supplicant data
- * @bssid: BSSID, zero addr matches any bssid
+ * @bssid: BSSID, 02:00:00:00:00:00 matches any bssid
* @ssid: SSID
* @ssid_len: Length of @ssid
* Returns: Pointer to the BSS entry or %NULL if not found
@@ -130,7 +139,7 @@ struct wpa_bss* findBssBySsid(
{
struct wpa_bss *bss;
dl_list_for_each(bss, &wpa_s->bss, struct wpa_bss, list) {
- if ((is_zero_ether_addr(bssid) ||
+ if ((isAnyEtherAddr(bssid) ||
os_memcmp(bss->bssid, bssid, ETH_ALEN) == 0) &&
bss->ssid_len == ssid_len &&
os_memcmp(bss->ssid, ssid, ssid_len) == 0)