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 <sunilravi@google.com>
This commit is contained in:
Sunil Ravi 2022-09-07 20:23:05 +00:00 committed by Jouni Malinen
parent 01944c0957
commit ee7eec5185

View file

@ -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);