[PATCH] Revert "Revert "mesh: Apply channel attributes before setup interface""

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Peter Oh <peter.oh@xxxxxxxxxxxxxxxxx>

This reverts commit 3e949655ccc5fba4686d04c70380463ebf059b30.

The previous reverted commit was because it was complaint
a memory leak. This is the previous commit message.
"commit 2564184440d9d6041d11a8c7d50b31368634c3bd 'mesh: Apply
channel attributes before setup interface' causes memory
leakage of auto test mesh_secure_ocv_mix_legacy."

But the error doesn't happen anymore on top of the tip of tree.

~/hostap/tests/hwsim$ sudo ./run-tests.py mesh_secure_ocv_mix_legacy
DEV: wlan0: 02:00:00:00:00:00
DEV: wlan1: 02:00:00:00:01:00
DEV: wlan2: 02:00:00:00:02:00
APDEV: wlan3
APDEV: wlan4
START mesh_secure_ocv_mix_legacy 1/1
Test: Mesh network with a VHT STA and a legacy STA under OCV
PASS mesh_secure_ocv_mix_legacy 1.035373 2019-05-23 10:45:29.676765
passed all 1 test case(s)

Also all of wap_mesh test results shows the same result as without
this change.
- passed all 73 test case(s)
- skipped 1 test case(s)

The tip of hostap commit tested is
commit a96c7836451860f93f88bd739c132645dd581af1
Author: Jouni Malinen <jouni@xxxxxxxxxxxxxx>
Date:   Wed May 8 22:06:46 2019 +0300
    dbus: Fix some memory leaks on error paths

using Ubuntu 18.04.2 LTS stock kernel,
4.18.0-15-generic #16~18.04.1-Ubuntu SMP Thu Feb 7 14:06:04 UTC 2019 x86_64
---
 wpa_supplicant/mesh.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/wpa_supplicant/mesh.c b/wpa_supplicant/mesh.c
index 92600211a..148078a85 100644
--- a/wpa_supplicant/mesh.c
+++ b/wpa_supplicant/mesh.c
@@ -249,7 +249,7 @@ static int wpa_supplicant_mesh_init(struct wpa_supplicant *wpa_s,
 	struct mesh_conf *mconf;
 	int basic_rates_erp[] = { 10, 20, 55, 60, 110, 120, 240, -1 };
 	int rate_len;
-	int frequency;
+	int frequency, saved_freq;
 
 	if (!wpa_s->conf->user_mpm) {
 		/* not much for us to do here */
@@ -381,6 +381,13 @@ static int wpa_supplicant_mesh_init(struct wpa_supplicant *wpa_s,
 		conf->basic_rates[rate_len] = -1;
 	}
 
+	/* Handle pri/sec switch frequency within AP configuration parameter
+	 * generation without changing the stored network profile in the end. */
+	saved_freq = ssid->frequency;
+	ssid->frequency = frequency;
+	wpa_supplicant_conf_ap_ht(wpa_s, ssid, conf);
+	ssid->frequency = saved_freq;
+
 	if (wpa_drv_init_mesh(wpa_s)) {
 		wpa_msg(wpa_s, MSG_ERROR, "Failed to init mesh in driver");
 		return -1;
@@ -392,8 +399,6 @@ static int wpa_supplicant_mesh_init(struct wpa_supplicant *wpa_s,
 		return -1;
 	}
 
-	wpa_supplicant_conf_ap_ht(wpa_s, ssid, conf);
-
 	return 0;
 out_free:
 	wpa_supplicant_mesh_deinit(wpa_s);
-- 
2.17.1

_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux