From: Jouni Malinen Date: Sat, 10 Jul 2010 00:23:11 +0000 (-0700) Subject: P2P: Fix device discoverability to not wait before sending GO Neg Req X-Git-Tag: hostap-1-bp~1094 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0af196088c2529ac769239cb4802dd06e9409abc;p=thirdparty%2Fhostap.git P2P: Fix device discoverability to not wait before sending GO Neg Req When we receive Device Discoverability Response, we need to initiate new GO Negotiation as quickly as possible to avoid the target client from going back to sleep. Make sure we do not end up in P2P_CONNECT_LISTEN state (short Listen mode) in this case. --- diff --git a/src/p2p/p2p_dev_disc.c b/src/p2p/p2p_dev_disc.c index ac2a1779f..7bd080ad8 100644 --- a/src/p2p/p2p_dev_disc.c +++ b/src/p2p/p2p_dev_disc.c @@ -293,6 +293,15 @@ void p2p_process_dev_disc_resp(struct p2p_data *p2p, const u8 *sa, */ wpa_msg(p2p->cfg->msg_ctx, MSG_DEBUG, "P2P: Client discoverability request succeeded"); + if (p2p->state == P2P_CONNECT) { + /* + * Change state to force the timeout to start in + * P2P_CONNECT again without going through the short + * Listen state. + */ + p2p_set_state(p2p, P2P_CONNECT_LISTEN); + p2p->cfg->send_action_done(p2p->cfg->cb_ctx); + } p2p_set_timeout(p2p, 0, 0); } else { /*