[PATCH] nl80211: unbreak mode processing due to presence of S1G band

Thomas Pedersen thomas at adapt-ip.com
Thu Aug 27 18:59:40 EDT 2020


if kernel advertises a band with channels < 2.4GHz hostap
gets confused and assumes they're 11b, corrupting the real
11b band info.

Signed-off-by: Thomas Pedersen <thomas at adapt-ip.com>
---
 src/drivers/driver_nl80211_capa.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c
index 46f61fdbf925..625fe5d0bc5e 100644
--- a/src/drivers/driver_nl80211_capa.c
+++ b/src/drivers/driver_nl80211_capa.c
@@ -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) {
-- 
2.20.1




More information about the Hostap mailing list