From: Constantin Musca Date: Fri, 12 Sep 2014 07:22:19 +0000 (+0300) Subject: P2P: Stop driver listen in p2p_state_timeout() X-Git-Tag: hostap_2_4~1239 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a902d5a64b825a778992e26c0add98479e9c3b39;p=thirdparty%2Fhostap.git 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 --- diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c index a5712eb56..f28629e92 100644 --- a/src/p2p/p2p.c +++ b/src/p2p/p2p.c @@ -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: