aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Shmidt <dimitrysh@google.com>2012-09-13 10:52:13 -0700
committerDmitry Shmidt <dimitrysh@google.com>2012-09-13 10:52:13 -0700
commit2b380488c6b5d21e54e98397c7a8d6a9f16dd8b5 (patch)
treedc7107c80cd887f007a8dfab9981d3c3f39dd5b6
parent07f427a83c1bd048f8c4b6515d45f81e96877e37 (diff)
downloadexternal_wpa_supplicant_8-2b380488c6b5d21e54e98397c7a8d6a9f16dd8b5.zip
external_wpa_supplicant_8-2b380488c6b5d21e54e98397c7a8d6a9f16dd8b5.tar.gz
external_wpa_supplicant_8-2b380488c6b5d21e54e98397c7a8d6a9f16dd8b5.tar.bz2
P2P: Skip join in case of provision discovery failure
Change-Id: I46cb3d2f17a45bf0ff62697040602334b818d805 Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
-rw-r--r--wpa_supplicant/p2p_supplicant.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c
index 469e383..2cd2e8e 100644
--- a/wpa_supplicant/p2p_supplicant.c
+++ b/wpa_supplicant/p2p_supplicant.c
@@ -1203,7 +1203,6 @@ void wpas_dev_found(void *ctx, const u8 *addr,
WFD_DEV_INFO_SIZE);
}
#endif /* CONFIG_WIFI_DISPLAY */
-
wpa_msg(wpa_s, MSG_INFO, P2P_EVENT_DEVICE_FOUND MACSTR
" p2p_dev_addr=" MACSTR
" pri_dev_type=%s name='%s' config_methods=0x%x "
@@ -2199,6 +2198,18 @@ static void wpas_prov_disc_fail(void *ctx, const u8 *peer,
return;
}
+#ifdef ANDROID_P2P
+ /* If provision discovery failed it is safe to cancel the timer here and
+ * also do not start the join */
+ 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: Do not Start pending "
+ "join-existing-group operation");
+ eloop_cancel_timeout(wpas_p2p_pd_before_join_timeout, wpa_s, NULL);
+ }
+#endif /* ANDROID_P2P */
wpa_msg(wpa_s, MSG_INFO, P2P_EVENT_PROV_DISC_FAILURE
" p2p_dev_addr=" MACSTR " status=%d",
MAC2STR(peer), status);