aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2012-02-05 18:20:36 (GMT)
committerJouni Malinen <j@w1.fi>2012-02-05 18:20:36 (GMT)
commitc19316354ed46e688704c1ebcf1c7efe816ddf31 (patch)
tree3bc5e6ba48461918353987e824d87e7c2dccc260 /wpa_supplicant
parente12b85d324e9692443d666728b5d078d652fabeb (diff)
downloadhostap-c19316354ed46e688704c1ebcf1c7efe816ddf31.zip
hostap-c19316354ed46e688704c1ebcf1c7efe816ddf31.tar.gz
hostap-c19316354ed46e688704c1ebcf1c7efe816ddf31.tar.bz2
P2P: Skip event notification on PD Response in join-group case
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>
Diffstat (limited to 'wpa_supplicant')
-rw-r--r--wpa_supplicant/p2p_supplicant.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c
index a6298a7..ffda3bb 100644
--- a/wpa_supplicant/p2p_supplicant.c
+++ b/wpa_supplicant/p2p_supplicant.c
@@ -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);
- }
}