diff mbox series

[RESEND,10/10] mesh: fix mesh_oom test

Message ID 20200626142822.272002-11-markus.theil@tu-ilmenau.de
State New
Headers show
Series mesh: support for DFS | expand

Commit Message

Markus Theil June 26, 2020, 2:28 p.m. UTC
Only change freq params, if ifmsh->freq is set initially, which only
happens if hostapd_get_hw_features in setup_interface2 succeeds.

Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
---
 wpa_supplicant/mesh.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/wpa_supplicant/mesh.c b/wpa_supplicant/mesh.c
index 0742cabbc..4c7cfa374 100644
--- a/wpa_supplicant/mesh.c
+++ b/wpa_supplicant/mesh.c
@@ -218,7 +218,7 @@  static int wpas_mesh_complete(struct wpa_supplicant *wpa_s)
 	 * inspect if channel's been changed since initialized.
 	 * i.e. DFS radar detection
 	 */
-	if (ifmsh->freq != params->freq.freq) {
+	if (ifmsh->freq > 0 && ifmsh->freq != params->freq.freq) {
 		wpa_s->assoc_freq = ifmsh->freq;
 		ssid->frequency = ifmsh->freq;
 		struct he_capabilities *he_capab = NULL;
@@ -447,7 +447,8 @@  static int wpa_supplicant_mesh_init(struct wpa_supplicant *wpa_s,
 	ifmsh->mconf = mconf;
 
 	/* need conf->hw_mode for supported rates. */
-	conf->hw_mode = ieee80211_freq_to_chan(frequency, &conf->channel);
+	conf->hw_mode = ieee80211_freq_to_channel_ext(frequency, 0, CHANWIDTH_USE_HT,
+						      &conf->op_class, &conf->channel);
 	if (conf->hw_mode == NUM_HOSTAPD_MODES) {
 		wpa_printf(MSG_ERROR, "Unsupported mesh mode frequency: %d MHz",
 			   frequency);