]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Do not accept any BSS entry for join if SSID is already known
authorJouni Malinen <jouni@qca.qualcomm.com>
Wed, 30 Dec 2015 17:02:33 +0000 (19:02 +0200)
committerJouni Malinen <j@w1.fi>
Wed, 30 Dec 2015 17:02:33 +0000 (19:02 +0200)
Use wpa_bss_get() with the specific Group SSID instead of
wpa_bss_get_bssid_latest() if the SSID is already known. This makes the
P2P join operations more robust in case the frequency of the group was
not yet known and the same P2P Interface Address may have been used in
multiple group instances with an older group entry still present in the
cached scan results.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
wpa_supplicant/p2p_supplicant.c

index 4040e61979a4723abb5f67a9ccfb33c9e2111c65..7b976515ef552b96dc6105300ea71d91fede4a73 100644 (file)
@@ -5091,8 +5091,13 @@ static int wpas_p2p_join_start(struct wpa_supplicant *wpa_s, int freq,
                res.ssid_len = ssid_len;
                os_memcpy(res.ssid, ssid, ssid_len);
        } else {
-               bss = wpa_bss_get_bssid_latest(wpa_s,
-                                              wpa_s->pending_join_iface_addr);
+               if (ssid && ssid_len) {
+                       bss = wpa_bss_get(wpa_s, wpa_s->pending_join_iface_addr,
+                                         ssid, ssid_len);
+               } else {
+                       bss = wpa_bss_get_bssid_latest(
+                               wpa_s, wpa_s->pending_join_iface_addr);
+               }
                if (bss) {
                        res.freq = bss->freq;
                        res.ssid_len = bss->ssid_len;