diff mbox

ap: Fix invalid HT40 channel pair fallback

Message ID 1496909880-3511-2-git-send-email-andrei.otcheretianski@intel.com
State Accepted
Headers show

Commit Message

Andrei Otcheretianski June 8, 2017, 8:17 a.m. UTC
From: Naftali Goldstein <naftali.goldstein@intel.com>

In case of incorrect HT40 configuration as part of an attempt to create
a 80MHZ softap, iface->conf->vht_oper_centr_freq_seg0_idx and
iface->conf->vht_oper_centr_freq_seg1_idx are zero'ed, but
iface->conf->vht_oper_chwidth remains VHT_CHANWIDTH_80MHZ. This causes
the logic in dfs_get_start_chan_idx to fail.

Fix this by setting iface->conf->vht_oper_chwidth to
VHT_CHANWIDTH_USE_HT when zero'ing the center frequency parameters.

Signed-off-by: Naftali Goldstein <naftali.goldstein@intel.com>
---
 src/ap/hw_features.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Jouni Malinen July 8, 2017, 7:32 p.m. UTC | #1
On Thu, Jun 08, 2017 at 11:17:55AM +0300, Andrei Otcheretianski wrote:
> In case of incorrect HT40 configuration as part of an attempt to create
> a 80MHZ softap, iface->conf->vht_oper_centr_freq_seg0_idx and
> iface->conf->vht_oper_centr_freq_seg1_idx are zero'ed, but
> iface->conf->vht_oper_chwidth remains VHT_CHANWIDTH_80MHZ. This causes
> the logic in dfs_get_start_chan_idx to fail.
> 
> Fix this by setting iface->conf->vht_oper_chwidth to
> VHT_CHANWIDTH_USE_HT when zero'ing the center frequency parameters.

Thanks, applied.
diff mbox

Patch

diff --git a/src/ap/hw_features.c b/src/ap/hw_features.c
index a53fd23..84e74ee 100644
--- a/src/ap/hw_features.c
+++ b/src/ap/hw_features.c
@@ -334,6 +334,7 @@  static void ieee80211n_check_scan(struct hostapd_iface *iface)
 		iface->conf->secondary_channel = 0;
 		iface->conf->vht_oper_centr_freq_seg0_idx = 0;
 		iface->conf->vht_oper_centr_freq_seg1_idx = 0;
+		iface->conf->vht_oper_chwidth = VHT_CHANWIDTH_USE_HT;
 		res = 1;
 		wpa_printf(MSG_INFO, "Fallback to 20 MHz");
 	}