]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Ignore remain-on-channel callback event if not waiting for one
authorJouni Malinen <jouni@qca.qualcomm.com>
Mon, 2 Feb 2015 11:32:06 +0000 (13:32 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 2 Feb 2015 12:09:18 +0000 (14:09 +0200)
It was possible for the previously requested remain-on-channel for P2P
listen state to get canceled before having received driver event
indicating start of that remain-on-channel operation. In such a case,
the event was able to trigger P2P module to start processing listen
timeout even though there was not supposed to be a following listen
operation anymore. Skip the driver event if we are not waiting for a new
listen state.

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

index 65c1b486f9fe8dbd092954a6b2ff035b223ea1be..dfc3c9c0ecdb4e63e92210b6a245c83dc8c7b980 100644 (file)
@@ -5089,7 +5089,11 @@ void wpas_p2p_remain_on_channel_cb(struct wpa_supplicant *wpa_s,
 {
        if (wpa_s->global->p2p_disabled || wpa_s->global->p2p == NULL)
                return;
-       if (wpa_s->off_channel_freq == wpa_s->pending_listen_freq) {
+       wpa_printf(MSG_DEBUG, "P2P: remain-on-channel callback (off_channel_freq=%u pending_listen_freq=%d roc_waiting_drv_freq=%d freq=%u duration=%u)",
+                  wpa_s->off_channel_freq, wpa_s->pending_listen_freq,
+                  wpa_s->roc_waiting_drv_freq, freq, duration);
+       if (wpa_s->off_channel_freq &&
+           wpa_s->off_channel_freq == wpa_s->pending_listen_freq) {
                p2p_listen_cb(wpa_s->global->p2p, wpa_s->pending_listen_freq,
                              wpa_s->pending_listen_duration);
                wpa_s->pending_listen_freq = 0;