Fix the issue in setting optimized listen channel
wpas_p2p_optimize_listen_channel() checks for the state
& 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 & current
interface of the caller.
Bug: 243880455
Test: Manual - connected STA to AP operating in one of the social channels
& confirmed from logs that p2p listen channel is set same as
STA-AP channel.
Change-Id: I67311e11ad1f254cc0b2b2428059b55b25f7d25a
diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c
index 2e7cc4c..94ad69b 100644
--- a/wpa_supplicant/p2p_supplicant.c
+++ b/wpa_supplicant/p2p_supplicant.c
@@ -9675,9 +9675,6 @@
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);