]> git.ipfire.org Git - thirdparty/hostap.git/commit
P2P: Recover from successfully requested, but not started, listen
authorJouni Malinen <j@w1.fi>
Sun, 10 Dec 2023 09:23:28 +0000 (11:23 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 10 Dec 2023 17:30:44 +0000 (19:30 +0200)
commit8e294c3a2c8f1d13a0979f9b6e2081d67d4d5e04
treed6a0c6a8a43e0e95072cc7130ffca662655ff015
parent97f7f9ce9bcc2789110e9e2297a27374d20bff5f
P2P: Recover from successfully requested, but not started, listen

It is possible for the start_listen() callback to be called to request
the driver to start a driver operation and stop_listen() called
immediately after that (e.g., due to a request to transmit a P2P Public
Action frame) before the driver has had time to start ROC and send an
event to notify of that. Such a sequence could result in
p2p->pending_listen_freq being left to a nonzero value without getting a
call to p2p_listen_cb() to clear it. This would stop an ongoing P2P
listen operation since no following p2p_listen() call would start the
listen due to the pending command being assumed to be in effect.

Fix this by detecting this particular sequence and clearing
p2p->pending_listen_freq.

This was found with the p2p_listen_and_offchannel_tx test case with the
new kernel scheduled and UML time-travel.

Signed-off-by: Jouni Malinen <j@w1.fi>
src/p2p/p2p.c
src/p2p/p2p_i.h