From: Sunil Ravi Date: Wed, 7 Sep 2022 20:23:05 +0000 (+0000) Subject: P2P: Fix the issue in setting optimized listen channel X-Git-Tag: hostap_2_11~1688 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ee7eec5185a074b27e1c080cd643dd9bd7697ab6;p=thirdparty%2Fhostap.git 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 --- 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);