From 6fb6264129e137d3ccd077cdeed30e7cc8c7855e Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 14 Feb 2021 19:32:23 +0200 Subject: [PATCH] P2P: Clear unexpected HT40 configuration on 2.4 GHz band 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 --- wpa_supplicant/ap.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/wpa_supplicant/ap.c b/wpa_supplicant/ap.c index caf1ef8c2..cfefa48d4 100644 --- a/wpa_supplicant/ap.c +++ b/wpa_supplicant/ap.c @@ -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 */