diff mbox series

[v8,08/16] mesh: update ssid->frequency as pri/sec channel switch

Message ID 5a46b40b844a421c2249dff1aa6936f1646a6a72.1535403927.git.peter.oh@bowerswilkins.com
State Changes Requested
Headers show
Series mesh: enable DFS channels in mesh mode | expand

Commit Message

Peter Oh Aug. 27, 2018, 9:28 p.m. UTC
From: Peter Oh <peter.oh@bowerswilkins.com>

ssid->frequency is one of variables used to gets channel
number from given frequency. Leave it as unchanged when
pri/sec channel switched will cause picking up wrong
channel number after applying secondary channel offset
for HT40 and leads failing interface bring-up.

Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
---
 wpa_supplicant/mesh.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Jouni Malinen Jan. 3, 2019, 1:19 p.m. UTC | #1
On Mon, Aug 27, 2018 at 02:28:41PM -0700, peter.oh@bowerswilkins.com wrote:
> ssid->frequency is one of variables used to gets channel
> number from given frequency. Leave it as unchanged when
> pri/sec channel switched will cause picking up wrong
> channel number after applying secondary channel offset
> for HT40 and leads failing interface bring-up.

> diff --git a/wpa_supplicant/mesh.c b/wpa_supplicant/mesh.c
> @@ -285,6 +285,7 @@ static int wpa_supplicant_mesh_init(struct wpa_supplicant *wpa_s,
>  	    frequency == freq->freq + freq->sec_channel_offset * 20) {
>  		wpa_printf(MSG_DEBUG, "mesh: pri/sec channels switched");
>  		frequency = freq->freq;
> +		ssid->frequency = frequency;

This does not look like the correct thing to do since this would end up
changing the stored network profile. I would simply drop this patch and
leave this to the workaround I applied with moving of
wpa_supplicant_conf_ap_ht() (i.e., change ssid->frequency only
temporarily during that call).
diff mbox series

Patch

diff --git a/wpa_supplicant/mesh.c b/wpa_supplicant/mesh.c
index ab748b6..06b82cd 100644
--- a/wpa_supplicant/mesh.c
+++ b/wpa_supplicant/mesh.c
@@ -285,6 +285,7 @@  static int wpa_supplicant_mesh_init(struct wpa_supplicant *wpa_s,
 	    frequency == freq->freq + freq->sec_channel_offset * 20) {
 		wpa_printf(MSG_DEBUG, "mesh: pri/sec channels switched");
 		frequency = freq->freq;
+		ssid->frequency = frequency;
 	}
 	wpa_s->assoc_freq = frequency;
 	wpa_s->current_ssid = ssid;