P2P: Continue find in GO-Neg-Resp-fail status corner cases
authorJouni Malinen <j@w1.fi>
Sun, 1 Mar 2015 20:35:21 +0000 (22:35 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 1 Mar 2015 20:36:52 +0000 (22:36 +0200)
It was possible for the GO Negotiation Response (failure) TX status to
be processed at a point where there is no P2P timeout to continue
search. Avoid stopping the ongoing search operation by explicitly
restarting it from this callback.

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

index 32f6833..6adb3dc 100644 (file)
@@ -3521,13 +3521,19 @@ static void p2p_go_neg_resp_failure_cb(struct p2p_data *p2p, int success,
        p2p_dbg(p2p, "GO Negotiation Response (failure) TX callback: success=%d", success);
        if (p2p->go_neg_peer && p2p->go_neg_peer->status != P2P_SC_SUCCESS) {
                p2p_go_neg_failed(p2p, p2p->go_neg_peer->status);
-       } else if (success) {
+               return;
+       }
+
+       if (success) {
                struct p2p_device *dev;
                dev = p2p_get_device(p2p, addr);
                if (dev &&
                    dev->status == P2P_SC_FAIL_INFO_CURRENTLY_UNAVAILABLE)
                        dev->flags |= P2P_DEV_PEER_WAITING_RESPONSE;
        }
+
+       if (p2p->state == P2P_SEARCH || p2p->state == P2P_SD_DURING_FIND)
+               p2p_continue_find(p2p);
 }