diff mbox

[11/18] P2P: Resume P2P long listen after off channel TX

Message ID 1473085991-5073-11-git-send-email-andrei.otcheretianski@intel.com
State Changes Requested
Headers show

Commit Message

Andrei Otcheretianski Sept. 5, 2016, 2:33 p.m. UTC
From: Avraham Stern <avraham.stern@intel.com>

P2P long listen that was stopped for off-channel action TX is not
resumed when the action frame sequence is done but only on the
TX status event. However, it is possible that by the time the
TX status event is received the action frame sequence was already
done. In such case P2P long listen will not be resumed since the
TX status event is being ignored.
Fix this by also resuming P2P long listen when action frame sequence
is done.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
---
 wpa_supplicant/p2p_supplicant.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Jouni Malinen Sept. 26, 2016, 9:42 p.m. UTC | #1
On Mon, Sep 05, 2016 at 05:33:04PM +0300, andrei.otcheretianski@intel.com wrote:
> P2P long listen that was stopped for off-channel action TX is not
> resumed when the action frame sequence is done but only on the
> TX status event. However, it is possible that by the time the
> TX status event is received the action frame sequence was already
> done. In such case P2P long listen will not be resumed since the
> TX status event is being ignored.
> Fix this by also resuming P2P long listen when action frame sequence
> is done.

Could you please provide a debug log showing a case where the long
listen is stopped or at least describe a frame sequence where this can
happen? I would like to get a hwsim test case for this, but when trying
to write one, I could not get this to trigger since no offchannel TX
case stopped the exchange based on the first frame before receiving the
TX status event.
Ilan Peer Sept. 27, 2016, 7:38 a.m. UTC | #2
> -----Original Message-----
> From: Hostap [mailto:hostap-bounces@lists.infradead.org] On Behalf Of
> Jouni Malinen
> Sent: Tuesday, September 27, 2016 00:42
> To: Otcheretianski, Andrei <andrei.otcheretianski@intel.com>
> Cc: hostap@lists.infradead.org; Stern, Avraham <avraham.stern@intel.com>
> Subject: Re: [PATCH 11/18] P2P: Resume P2P long listen after off channel TX
> 
> On Mon, Sep 05, 2016 at 05:33:04PM +0300, andrei.otcheretianski@intel.com
> wrote:
> > P2P long listen that was stopped for off-channel action TX is not
> > resumed when the action frame sequence is done but only on the TX
> > status event. However, it is possible that by the time the TX status
> > event is received the action frame sequence was already done. In such
> > case P2P long listen will not be resumed since the TX status event is
> > being ignored.
> > Fix this by also resuming P2P long listen when action frame sequence
> > is done.
> 
> Could you please provide a debug log showing a case where the long listen is
> stopped or at least describe a frame sequence where this can happen? I
> would like to get a hwsim test case for this, but when trying to write one, I
> could not get this to trigger since no offchannel TX case stopped the
> exchange based on the first frame before receiving the TX status event.
> 

Avi might have such a log but he is currently travelling.

A possible flow for this is a GoN, where the local P2P Device expects a GoN confirm frame, but before getting the Tx status event p2p_timeout_connect() fires, in which case the action sequence would be cancelled. Not sure that this is the same sequence Avi saw.

Regards,

Ilan.
diff mbox

Patch

diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c
index 21b6213..a6184db 100644
--- a/wpa_supplicant/p2p_supplicant.c
+++ b/wpa_supplicant/p2p_supplicant.c
@@ -1607,6 +1607,12 @@  static void wpas_send_action_done(void *ctx)
 	}
 
 	offchannel_send_action_done(wpa_s);
+
+	if (wpa_s->p2p_long_listen > 0) {
+		/* Continue the listen */
+		wpa_printf(MSG_DEBUG, "P2P: Continuing long Listen state");
+		wpas_p2p_listen_start(wpa_s, wpa_s->p2p_long_listen);
+	}
 }