[PATCH 1/1] P2P: Cancel pending action tx radio work on p2p_cancel

Jithu Jance jithu
Tue Jul 29 06:04:32 PDT 2014


When p2p_cancel is invoked while the GO Neg action tx
was pending, the p2p_send_action_work was not getting
cleared.

Signed-off-by: Jithu Jance <jithu at broadcom.com>
---
 wpa_supplicant/p2p_supplicant.c |   23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c
index f1269ad..d64cd21 100644
--- a/wpa_supplicant/p2p_supplicant.c
+++ b/wpa_supplicant/p2p_supplicant.c
@@ -5684,6 +5684,29 @@ static void wpas_p2p_clear_pending_action_tx(struct wpa_supplicant *wpa_s)
 	if (!offchannel_pending_action_tx(wpa_s))
 		return;

+    if (wpa_s->p2p_send_action_work) {
+        struct send_action_work *awork;
+        awork = wpa_s->p2p_send_action_work->ctx;
+        if (awork->wait_time == 0) {
+            os_free(awork);
+            radio_work_done(wpa_s->p2p_send_action_work);
+            wpa_s->p2p_send_action_work = NULL;
+        } else {
+            /*
+             * In theory,   this should not be needed, but number of
+             * places in the P2P code is still using non-zero wait
+             * time for the last Action frame in the sequence and
+             * some of these do not call send_action_done().
+             */
+            eloop_cancel_timeout(wpas_p2p_send_action_work_timeout,
+                wpa_s, NULL);
+            eloop_register_timeout(
+                0, awork->wait_time * 1000,
+                wpas_p2p_send_action_work_timeout,
+                wpa_s, NULL);
+        }
+    }
+
 	wpa_printf(MSG_DEBUG, "P2P: Drop pending Action TX due to new "
 		   "operation request");
 	offchannel_clear_pending_action_tx(wpa_s);
--
1.7.9.5




More information about the Hostap mailing list