From: Hector Jiang Date: Thu, 28 Apr 2022 10:56:33 +0000 (+0800) Subject: P2P: Skip 6 GHz band directly if 6 GHz P2P is disabled X-Git-Tag: hostap_2_11~1754 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e9627f8c32f816ed28a60d96d006e4d2338cc3c8;p=thirdparty%2Fhostap.git P2P: Skip 6 GHz band directly if 6 GHz P2P is disabled 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 --- diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c index 102c544d4..c252b6c59 100644 --- a/wpa_supplicant/scan.c +++ b/wpa_supplicant/scan.c @@ -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,