From 944f693591077d05c29cb60790bf0578eff216b4 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Thu, 31 Dec 2015 00:03:21 +0200 Subject: [PATCH] P2P: Stop offchannel TX wait on P2P_STOP_FIND/P2P_LISTEN 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 --- wpa_supplicant/p2p_supplicant.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c index af623ad9e..9b36b6382 100644 --- a/wpa_supplicant/p2p_supplicant.c +++ b/wpa_supplicant/p2p_supplicant.c @@ -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");