P2P: Use specific go_bssid field instead of generic bssid field
The bssid field stores the value of the P2P Device Address, not the P2P
interface address, but the interface address is the one that is used for
the BSSID of the resulting GO (see
http://lists.infradead.org/pipermail/hostap/2023-February/041392.html
for details).
This was fixed in the patch that was eventually upstreamed. Align it
here.
Bug: 233925359
Test: set up GO on a device with P2P test app, discovered GO on client
device with wifi picker, switched to P2P test app on client device and
joined the group, looked at logs to verify that scan retry mechanism
works as expected (only GO frequency scanned)
Test: persistent connection using WiFi Direct in Settings menu - connect, disconnect, reconnect (no dialog box).
Change-Id: I5aa732c6f72d6e287896d7fc4e0d5b08a1035627
diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c
index 88d7e6e..3fd86be 100644
--- a/wpa_supplicant/scan.c
+++ b/wpa_supplicant/scan.c
@@ -466,15 +466,19 @@
}
if (bss && !disabled_freq(wpa_s, bss->freq)) {
params->freqs = os_calloc(2, sizeof(int));
- if (params->freqs)
+ if (params->freqs) {
+ wpa_dbg(wpa_s, MSG_DEBUG,
+ "P2P: Scan only the known GO frequency %d MHz during invitation",
+ bss->freq);
params->freqs[0] = bss->freq;
+ }
}
}
/*
* Optimize scan based on GO information during persistent
* group reinvocation
*/
- if (params->freqs == NULL && wpa_s->p2p_in_invitation < 5 &&
+ if (!params->freqs && wpa_s->p2p_in_invitation < 5 &&
wpa_s->p2p_invite_go_freq > 0) {
if (wpa_s->p2p_invite_go_freq == 2 ||
wpa_s->p2p_invite_go_freq == 5) {