]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Skip 6 GHz band directly if 6 GHz P2P is disabled
authorHector Jiang <jianghaitao@zeku.com>
Thu, 28 Apr 2022 10:56:33 +0000 (18:56 +0800)
committerJouni Malinen <j@w1.fi>
Wed, 31 Aug 2022 14:12:58 +0000 (17:12 +0300)
If 6 GHz is supported by the device but 6 GHz P2P is disabled, P2P
invitation would fail if the GO select an operating channel which is not
the preferred channel. The root cause is that the 5 GHz and 6 GHz bands
are both HOSTAPD_MODE_IEEE80211A so the 5 GHz channels would be added
twice for the P2P Client's following scanning frequency list. This will
cause scanning to fail with -EINVAL. Fix this by adding the 5 GHz
channels only once.

Signed-off-by: Hector Jiang <jianghaitao@zeku.com>
wpa_supplicant/scan.c

index 102c544d4f75e96876dc0df6229f323816b37dc6..c252b6c5912465d554cbf1d5fa7f03c2291e1202 100644 (file)
@@ -1380,6 +1380,8 @@ scan:
                for (i = 0; i < wpa_s->hw.num_modes; i++) {
                        if (wpa_s->hw.modes[i].num_channels == 0)
                                continue;
+                       if (is_6ghz_freq(wpa_s->hw.modes[i].channels[0].freq))
+                               continue;
                        if (wpa_s->hw.modes[i].mode == HOSTAPD_MODE_IEEE80211G)
                                wpa_add_scan_freqs_list(
                                        wpa_s, HOSTAPD_MODE_IEEE80211G,