]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Clear pending_listen_freq when stopping listen
authorAndrei Otcheretianski <andrei.otcheretianski@intel.com>
Sun, 7 Mar 2021 21:40:02 +0000 (23:40 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 12 Mar 2021 08:38:14 +0000 (10:38 +0200)
If listen work never started, pending_listen_freq might be left
uncleared, preventing the subsequent listen to start. This could happen
in p2p_timeout_wait_peer_idle() after the commit 13256b8cf ("P2P: Stop
old listen radio work before go to WAIT_PEER_IDLE state") added a
stop_listen() call there.

Fixes: 13256b8cf3ed ("P2P: Stop old listen radio work before go to WAIT_PEER_IDLE state")
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
src/p2p/p2p.c

index 81bb937b3611ad025a2fc2cd381d7f6bbb713fdb..1aa98f1a877a69a53870c96f6c721e3865296125 100644 (file)
@@ -3994,6 +3994,10 @@ static void p2p_timeout_wait_peer_idle(struct p2p_data *p2p)
 
        p2p_dbg(p2p, "Go to Listen state while waiting for the peer to become ready for GO Negotiation");
        p2p->cfg->stop_listen(p2p->cfg->cb_ctx);
+       if (p2p->pending_listen_freq) {
+               p2p_dbg(p2p, "Clear pending_listen_freq for %s", __func__);
+               p2p->pending_listen_freq = 0;
+       }
        p2p_set_state(p2p, P2P_WAIT_PEER_CONNECT);
        p2p_listen_in_find(p2p, 0);
 }