P2P: Ignore remain-on-channel callback event if not waiting for one

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>
This commit is contained in:
Jouni Malinen 2015-02-02 13:32:06 +02:00 committed by Jouni Malinen
parent 6a6569b8bd
commit f2dc06e2bd

View 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;