[PATCH] Fix a logical error of workaround of listen failure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



when p2p->state == P2P_LISTEN_ONLY is true, the statement before it
'p2p->cfg->is_p2p_in_progress(p2p->cfg->cb_ctx)' will be true too,
so this function will print a message "Operation in progress" and
 return, the workaround to handle listen failure will be never reached.

I had met such error, the 'remain-on-channel' command failed, then the
function p2p_ext_listen_timeout just printed 'Operation in progress'
again and again, the listen was not started anymore.

Signed-off-by: zhuhai <zhuhai.mail@xxxxxxx>
---
 src/p2p/p2p.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c
index 7e11abff4..1327a56b8 100644
--- a/src/p2p/p2p.c
+++ b/src/p2p/p2p.c
@@ -4662,15 +4662,6 @@ static void p2p_ext_listen_timeout(void *eloop_ctx, void *timeout_ctx)
                       p2p_ext_listen_timeout, p2p, NULL);
    }

-   if ((p2p->cfg->is_p2p_in_progress &&
-        p2p->cfg->is_p2p_in_progress(p2p->cfg->cb_ctx)) ||
-       (p2p->pending_action_state == P2P_PENDING_PD &&
-        p2p->pd_retries > 0)) {
-       p2p_dbg(p2p, "Operation in progress - skip Extended Listen timeout (%s)",
-           p2p_state_txt(p2p->state));
-       return;
-   }
-
    if (p2p->state == P2P_LISTEN_ONLY && p2p->ext_listen_only) {
        /*
         * This should not really happen, but it looks like the Listen
@@ -4683,6 +4674,15 @@ static void p2p_ext_listen_timeout(void *eloop_ctx, void *timeout_ctx)
        p2p_set_state(p2p, P2P_IDLE);
    }

+   if ((p2p->cfg->is_p2p_in_progress &&
+        p2p->cfg->is_p2p_in_progress(p2p->cfg->cb_ctx)) ||
+       (p2p->pending_action_state == P2P_PENDING_PD &&
+        p2p->pd_retries > 0)) {
+       p2p_dbg(p2p, "Operation in progress - skip Extended Listen timeout (%s)",
+           p2p_state_txt(p2p->state));
+       return;
+   }
+
    if (p2p->state != P2P_IDLE) {
        p2p_dbg(p2p, "Skip Extended Listen timeout in active state (%s)", p2p_state_txt(p2p->state));
        return;
--
2.42.0

_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux