nl80211: Unbreak mode processing due to presence of S1G band

If kernel advertises a band with channels < 2.4 GHz
hostapd/wpa_supplicant gets confused and assumes this is an IEEE
802.11b, corrupting the real IEEE 802.11b band info.

Signed-off-by: Thomas Pedersen <thomas@adapt-ip.com>
This commit is contained in:
Thomas Pedersen 2020-08-27 15:59:40 -07:00 committed by Jouni Malinen
parent 4b96fafcd8
commit 52a1b28345

View file

@ -1946,7 +1946,10 @@ wpa_driver_nl80211_postprocess_modes(struct hostapd_hw_modes *modes,
for (m = 0; m < *num_modes; m++) { for (m = 0; m < *num_modes; m++) {
if (!modes[m].num_channels) if (!modes[m].num_channels)
continue; continue;
if (modes[m].channels[0].freq < 4000) { if (modes[m].channels[0].freq < 2000) {
modes[m].num_channels = 0;
continue;
} else if (modes[m].channels[0].freq < 4000) {
modes[m].mode = HOSTAPD_MODE_IEEE80211B; modes[m].mode = HOSTAPD_MODE_IEEE80211B;
for (i = 0; i < modes[m].num_rates; i++) { for (i = 0; i < modes[m].num_rates; i++) {
if (modes[m].rates[i] > 200) { if (modes[m].rates[i] > 200) {