From ee7eec5185a074b27e1c080cd643dd9bd7697ab6 Mon Sep 17 00:00:00 2001 From: Sunil Ravi Date: Wed, 7 Sep 2022 20:23:05 +0000 Subject: [PATCH] P2P: Fix the issue in setting optimized listen channel wpas_p2p_optimize_listen_channel() checks for the state and current ssid of the interface calling this function. This check prevents the function from setting the optimized listen channel. Since the listen channel is stored in global P2P configuration data, do not check the state and current interface of the caller. Signed-off-by: Sunil Ravi --- wpa_supplicant/p2p_supplicant.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c index 6a1f882da..cb78a30d9 100644 --- a/wpa_supplicant/p2p_supplicant.c +++ b/wpa_supplicant/p2p_supplicant.c @@ -9600,9 +9600,6 @@ static void wpas_p2p_optimize_listen_channel(struct wpa_supplicant *wpa_s, if (!wpa_s->conf->p2p_optimize_listen_chan) return; - if (!wpa_s->current_ssid || wpa_s->wpa_state != WPA_COMPLETED) - return; - curr_chan = p2p_get_listen_channel(wpa_s->global->p2p); for (i = 0, cand = 0; i < num; i++) { ieee80211_freq_to_chan(freqs[i].freq, &chan);