From 7549c178acb7fb11241a667c75d6c6c42cd15f13 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sat, 27 Sep 2014 13:15:47 +0300 Subject: [PATCH] P2P: Clear pending_listen_freq when starting GO Neg/Invite Previously, it was possible for the p2p->pending_listen_freq to be left at non-zero value if Probe Request frame was received from a peer with which we were waiting to start GO Negotiation/Invite process. That could result in the following Listen operation getting blocked in some operation sequences if the peer did not acknowledge the following P2P Public Action frame. Signed-off-by: Jouni Malinen --- src/p2p/p2p.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c index e746310e5..c4676ed38 100644 --- a/src/p2p/p2p.c +++ b/src/p2p/p2p.c @@ -1825,6 +1825,10 @@ static void p2p_go_neg_start(void *eloop_ctx, void *timeout_ctx) struct p2p_data *p2p = eloop_ctx; if (p2p->go_neg_peer == NULL) return; + if (p2p->pending_listen_freq) { + p2p_dbg(p2p, "Clear pending_listen_freq for p2p_go_neg_start"); + p2p->pending_listen_freq = 0; + } p2p->cfg->stop_listen(p2p->cfg->cb_ctx); p2p->go_neg_peer->status = P2P_SC_SUCCESS; p2p_connect_send(p2p, p2p->go_neg_peer); @@ -1836,6 +1840,10 @@ static void p2p_invite_start(void *eloop_ctx, void *timeout_ctx) struct p2p_data *p2p = eloop_ctx; if (p2p->invite_peer == NULL) return; + if (p2p->pending_listen_freq) { + p2p_dbg(p2p, "Clear pending_listen_freq for p2p_invite_start"); + p2p->pending_listen_freq = 0; + } p2p->cfg->stop_listen(p2p->cfg->cb_ctx); p2p_invite_send(p2p, p2p->invite_peer, p2p->invite_go_dev_addr, p2p->invite_dev_pw_id);