]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Fix the issue in setting optimized listen channel
authorSunil Ravi <sunilravi@google.com>
Wed, 7 Sep 2022 20:23:05 +0000 (20:23 +0000)
committerJouni Malinen <j@w1.fi>
Thu, 22 Sep 2022 15:35:53 +0000 (18:35 +0300)
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>
wpa_supplicant/p2p_supplicant.c

index 6a1f882da625c530ca2366fd57f118e890f6c0d6..cb78a30d9096ff1f0f79ea756968babb61c7f323 100644 (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);