aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/events.c
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2013-09-07 22:42:53 (GMT)
committerJouni Malinen <j@w1.fi>2013-11-07 11:49:01 (GMT)
commit9ec876662b7630fe555b4c6838331f45e8a95ba1 (patch)
tree875d84bfb334b1c12d631d07ed3fb7439cfc1770 /wpa_supplicant/events.c
parent83eefb40b593e671e2ca88a17e57b2feba2c64b9 (diff)
downloadhostap-9ec876662b7630fe555b4c6838331f45e8a95ba1.zip
hostap-9ec876662b7630fe555b4c6838331f45e8a95ba1.tar.gz
hostap-9ec876662b7630fe555b4c6838331f45e8a95ba1.tar.bz2
P2P: Allow GO P2P Device Address to be used for scan result matching
This is a better way of matching P2P groups based on the unique P2P Device Address (e.g., from P2P Group ID) and SSID pair instead of using the not necessarily unique P2P Interface Address. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'wpa_supplicant/events.c')
-rw-r--r--wpa_supplicant/events.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index fc66225..4493772 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -866,6 +866,32 @@ static struct wpa_ssid * wpa_scan_res_match(struct wpa_supplicant *wpa_s,
continue;
}
+ if (!is_zero_ether_addr(ssid->go_p2p_dev_addr)) {
+ struct wpabuf *p2p_ie;
+ u8 dev_addr[ETH_ALEN];
+
+ ie = wpa_bss_get_vendor_ie(bss, P2P_IE_VENDOR_TYPE);
+ if (ie == NULL) {
+ wpa_dbg(wpa_s, MSG_DEBUG, " skip - no P2P element");
+ continue;
+ }
+ p2p_ie = wpa_bss_get_vendor_ie_multi(
+ bss, P2P_IE_VENDOR_TYPE);
+ if (p2p_ie == NULL) {
+ wpa_dbg(wpa_s, MSG_DEBUG, " skip - could not fetch P2P element");
+ continue;
+ }
+
+ if (p2p_parse_dev_addr_in_p2p_ie(p2p_ie, dev_addr) < 0
+ || os_memcmp(dev_addr, ssid->go_p2p_dev_addr,
+ ETH_ALEN) != 0) {
+ wpa_dbg(wpa_s, MSG_DEBUG, " skip - no matching GO P2P Device Address in P2P element");
+ wpabuf_free(p2p_ie);
+ continue;
+ }
+ wpabuf_free(p2p_ie);
+ }
+
/*
* TODO: skip the AP if its P2P IE has Group Formation
* bit set in the P2P Group Capability Bitmap and we