From 2e3bff5919e1007b4b2084a524eade9a0053fdd6 Mon Sep 17 00:00:00 2001 From: Sunil Dutt Date: Thu, 9 May 2019 16:35:03 +0530 Subject: [PATCH] P2P: Reject p2p-send-action work while other one is pending The previous implementation rejects the p2p-send-action work while there is already one in progress (wpas_send_action_cb() has already been called for it to start operation). Enhance the same to also consider any p2p-send-action works pending in the radio work (i.e., waiting for that wpas_send_action_cb() call). This is considering the current behaviour of P2P to handle the state corresponding to respective Action frame transmission: pending_action_state. If a new P2P Action frame transmission is queued while there is another one already in the queue, the transmit status of the first frame is wrongly intepreted by the P2P state machine which has already scheduled/queued another frame for transmission. Signed-off-by: Jouni Malinen --- wpa_supplicant/p2p_supplicant.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c index a56cdd0b0..8e260a006 100644 --- a/wpa_supplicant/p2p_supplicant.c +++ b/wpa_supplicant/p2p_supplicant.c @@ -1556,7 +1556,7 @@ static int wpas_send_action_work(struct wpa_supplicant *wpa_s, { struct send_action_work *awork; - if (wpa_s->p2p_send_action_work) { + if (radio_work_pending(wpa_s, "p2p-send-action")) { wpa_printf(MSG_DEBUG, "P2P: Cannot schedule new p2p-send-action work since one is already pending"); return -1; }