]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Skip event notification on PD Response in join-group case
authorJouni Malinen <j@w1.fi>
Sun, 5 Feb 2012 18:20:36 +0000 (20:20 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 5 Feb 2012 18:20:36 +0000 (20:20 +0200)
Provision Discovery is used as a notification to the GO in the case we
are about join a running group. In such case, there is not much point in
indicating the provision discovery response events to external programs
especially when the PIN-to-be-displayed was different from the one
returned for the p2p_connect command. Skip this confusing event
completely for join-a-running-group case.

Signed-hostap: Jouni Malinen <j@w1.fi>

wpa_supplicant/p2p_supplicant.c

index a6298a7ddcd6f47d11dd37ac4fc69a4140a033d8..ffda3bb6f37de601ba7ba4b7e787b891e61ab528 100644 (file)
@@ -1808,6 +1808,16 @@ void wpas_prov_disc_resp(void *ctx, const u8 *peer, u16 config_methods)
        struct wpa_supplicant *wpa_s = ctx;
        unsigned int generated_pin = 0;
 
+       if (wpa_s->pending_pd_before_join &&
+           (os_memcmp(peer, wpa_s->pending_join_dev_addr, ETH_ALEN) == 0 ||
+            os_memcmp(peer, wpa_s->pending_join_iface_addr, ETH_ALEN) == 0)) {
+               wpa_s->pending_pd_before_join = 0;
+               wpa_printf(MSG_DEBUG, "P2P: Starting pending "
+                          "join-existing-group operation");
+               wpas_p2p_join_start(wpa_s);
+               return;
+       }
+
        if (config_methods & WPS_CONFIG_DISPLAY)
                wpas_prov_disc_local_keypad(wpa_s, peer, "");
        else if (config_methods & WPS_CONFIG_KEYPAD) {
@@ -1820,15 +1830,6 @@ void wpas_prov_disc_resp(void *ctx, const u8 *peer, u16 config_methods)
        wpas_notify_p2p_provision_discovery(wpa_s, peer, 0 /* response */,
                                            P2P_PROV_DISC_SUCCESS,
                                            config_methods, generated_pin);
-
-       if (wpa_s->pending_pd_before_join &&
-           (os_memcmp(peer, wpa_s->pending_join_dev_addr, ETH_ALEN) == 0 ||
-            os_memcmp(peer, wpa_s->pending_join_iface_addr, ETH_ALEN) == 0)) {
-               wpa_s->pending_pd_before_join = 0;
-               wpa_printf(MSG_DEBUG, "P2P: Starting pending "
-                          "join-existing-group operation");
-               wpas_p2p_join_start(wpa_s);
-       }
 }