diff mbox series

nl80211: unbreak mode processing due to presence of S1G band

Message ID 20200827225940.18151-1-thomas@adapt-ip.com
State Accepted
Headers show
Series nl80211: unbreak mode processing due to presence of S1G band | expand

Commit Message

Thomas Pedersen Aug. 27, 2020, 10:59 p.m. UTC
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@adapt-ip.com>
---
 src/drivers/driver_nl80211_capa.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Jouni Malinen Oct. 10, 2020, 6:50 p.m. UTC | #1
On Thu, Aug 27, 2020 at 03:59:40PM -0700, Thomas Pedersen wrote:
> if kernel advertises a band with channels < 2.4GHz hostap
> gets confused and assumes they're 11b, corrupting the real
> 11b band info.

Thanks, applied.
diff mbox series

Patch

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) {