]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Use specific SSID in scan for provisioning step
authorJouni Malinen <jouni@qca.qualcomm.com>
Tue, 28 Feb 2012 22:02:34 +0000 (00:02 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 28 Feb 2012 22:02:34 +0000 (00:02 +0200)
Since the P2P client learns the SSID of the group during GO Negotiation,
use the specific SSID in the Probe Request frames during the
provisioning step. This helps in avoiding unnecessary Probe Response
frames from other P2P GOs or APs.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

wpa_supplicant/scan.c

index 25b56b7d64f3f20c2700736d947c3603b56f4010..497900fdccf34b16d9338533a433554047333fd7 100644 (file)
@@ -512,6 +512,17 @@ static void wpa_supplicant_scan(void *eloop_ctx, void *timeout_ctx)
                }
        }
 
+#ifdef CONFIG_P2P
+       if (wpa_s->p2p_in_provisioning && wpa_s->go_params) {
+               wpa_printf(MSG_DEBUG, "P2P: Use specific SSID for scan during "
+                          "P2P provisioning");
+               params.ssids[0].ssid = wpa_s->go_params->ssid;
+               params.ssids[0].ssid_len = wpa_s->go_params->ssid_len;
+               params.num_ssids = 1;
+               goto ssid_list_set;
+       }
+#endif /* CONFIG_P2P */
+
        /* Find the starting point from which to continue scanning */
        ssid = wpa_s->conf->ssid;
        if (wpa_s->prev_scan_ssid != WILDCARD_SSID_SCAN) {
@@ -607,6 +618,9 @@ static void wpa_supplicant_scan(void *eloop_ctx, void *timeout_ctx)
                wpa_dbg(wpa_s, MSG_DEBUG, "Starting AP scan for wildcard "
                        "SSID");
        }
+#ifdef CONFIG_P2P
+ssid_list_set:
+#endif /* CONFIG_P2P */
 
        wpa_supplicant_optimize_freqs(wpa_s, &params);
        extra_ie = wpa_supplicant_extra_ies(wpa_s, &params);