P2P: Stop driver listen in p2p_state_timeout()

When a P2P timeout occurs and p2p_state_timeout is executed, the
stop_listen function can be called besides setting in_listen to zero in
cases where the driver is still in ROC. That should not really happen in
normal cases, but it is possible for some drivers to extend the ROC
duration. If that happens, the next start_listen request may get
rejected with "P2P: Reject start_listen since p2p_listen_work already
exists".

Signed-off-by: Constantin Musca <constantin.musca@intel.com>
This commit is contained in:
Constantin Musca 2014-09-12 10:22:19 +03:00 committed by Jouni Malinen
parent 431dd8bb11
commit a902d5a64b

View file

@ -3542,6 +3542,10 @@ static void p2p_state_timeout(void *eloop_ctx, void *timeout_ctx)
p2p_dbg(p2p, "Timeout (state=%s)", p2p_state_txt(p2p->state));
p2p->in_listen = 0;
if (p2p->drv_in_listen) {
p2p_dbg(p2p, "Driver is still in listen state - stop it");
p2p->cfg->stop_listen(p2p->cfg->cb_ctx);
}
switch (p2p->state) {
case P2P_IDLE: