P2P: Stop offchannel TX wait on P2P_STOP_FIND/P2P_LISTEN
authorJouni Malinen <jouni@qca.qualcomm.com>
Wed, 30 Dec 2015 22:03:21 +0000 (00:03 +0200)
committerJouni Malinen <j@w1.fi>
Wed, 30 Dec 2015 22:03:21 +0000 (00:03 +0200)
Previously it was possible for the pending Action frame TX to be
cleared, but the offchannel TX operation being left in wait state in the
kernel. This would delay start of the next operation (e.g., that listen
operation requested by P2P_LISTEN) until the wait time for the
previously pending Action frame had expired.

Optimize this by explicitly stopping any pending offchannel Action frame
TX when clearing the internal offchannel TX state in
wpas_p2p_clear_pending_action_tx().

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
wpa_supplicant/p2p_supplicant.c

index af623ad..9b36b63 100644 (file)
@@ -6505,8 +6505,12 @@ 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)
+       if (wpa_s->p2p_send_action_work) {
                wpas_p2p_free_send_action_work(wpa_s);
+               eloop_cancel_timeout(wpas_p2p_send_action_work_timeout,
+                                    wpa_s, NULL);
+               offchannel_send_action_done(wpa_s);
+       }
 
        wpa_printf(MSG_DEBUG, "P2P: Drop pending Action TX due to new "
                   "operation request");