]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Clear unexpected HT40 configuration on 2.4 GHz band
authorJouni Malinen <j@w1.fi>
Sun, 14 Feb 2021 17:32:23 +0000 (19:32 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 14 Feb 2021 17:32:23 +0000 (19:32 +0200)
Number of the P2P+NFC test cases have been failing every now and then
and those failures seemed to be because of having somehow managed to
select the GO's operating channel as HT40+ on the channel 11 in the 2.4
GHz band, i.e., something that is clearly incorrect. The P2P check for
HT40 secondary channel is supported only on the 5 GHz band, so drop HT40
configuration if it shows up unexpectedly on the 2.4 GHz band to avoid
issues in GO being able to start.

Signed-off-by: Jouni Malinen <j@w1.fi>
wpa_supplicant/ap.c

index caf1ef8c21ab6576c3a3dcdaf272d8fe001bd4cd..cfefa48d443e6bed1b875a6784a3120433e758b8 100644 (file)
@@ -266,6 +266,16 @@ int wpa_supplicant_conf_ap_ht(struct wpa_supplicant *wpa_s,
                                wpa_printf(MSG_DEBUG,
                                           "HT secondary channel offset %d for P2P group",
                                           conf->secondary_channel);
+                       } else if (ssid->p2p_group && conf->secondary_channel &&
+                                  conf->hw_mode != HOSTAPD_MODE_IEEE80211A) {
+                               /* This ended up trying to configure invalid
+                                * 2.4 GHz channels (e.g., HT40+ on channel 11)
+                                * in some cases, so clear the secondary channel
+                                * configuration now to avoid such cases that
+                                * would lead to group formation failures. */
+                               wpa_printf(MSG_DEBUG,
+                                          "Disable HT secondary channel for P2P group on 2.4 GHz");
+                               conf->secondary_channel = 0;
                        }
 #endif /* CONFIG_P2P */