]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
nl80211: Unbreak mode processing due to presence of S1G band
authorThomas Pedersen <thomas@adapt-ip.com>
Thu, 27 Aug 2020 22:59:40 +0000 (15:59 -0700)
committerJouni Malinen <j@w1.fi>
Sat, 10 Oct 2020 17:49:59 +0000 (20:49 +0300)
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>
src/drivers/driver_nl80211_capa.c

index 46f61fdbf9255104fb1f6b1ebdd3d1490df35eb8..625fe5d0bc5e11f907d9d6782e2eb46a939dc2b7 100644 (file)
@@ -1946,7 +1946,10 @@ wpa_driver_nl80211_postprocess_modes(struct hostapd_hw_modes *modes,
        for (m = 0; m < *num_modes; m++) {
                if (!modes[m].num_channels)
                        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;
                        for (i = 0; i < modes[m].num_rates; i++) {
                                if (modes[m].rates[i] > 200) {