[RFC 6/6] mesh: Update mesh join parameters from hostapd values before joining

Benjamin Berg benjamin at sipsolutions.net
Mon Nov 28 07:38:43 PST 2016


The channel may have changed because of DFS operations (i.e. if the channel
is unavailable). In that case hostapd_iface will have a new channel
configuration which needs to be synced back into the mesh join parameters.

Signed-off-by: Benjamin Berg <benjamin at sipsolutions.net>
---
 wpa_supplicant/mesh.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/wpa_supplicant/mesh.c b/wpa_supplicant/mesh.c
index 182d3ac..b0ec966 100644
--- a/wpa_supplicant/mesh.c
+++ b/wpa_supplicant/mesh.c
@@ -147,6 +147,7 @@ static void wpas_mesh_copy_groups(struct hostapd_data *bss,
 static void wpas_mesh_configured_cb(void *ctx)
 {
 	struct wpa_supplicant *wpa_s = ctx;
+	struct hostapd_iface *ifmsh = wpa_s->ifmsh;
 	struct wpa_driver_mesh_join_params *params = &wpa_s->mesh_join_params;
 	int ret;
 
@@ -158,6 +159,26 @@ static void wpas_mesh_configured_cb(void *ctx)
 		params->conf.ht_opmode = wpa_s->ifmsh->bss[0]->iface->ht_op_mode;
 	}
 
+	/* The DFS code may have modified the frequency parameters in the
+	 * meantime (if the channel is unavailable). So we need to syncronize
+	 * any changes back into our mesh join parameters. */
+	ret = hostapd_set_freq_params(&params->freq,
+				      ifmsh->conf->hw_mode,
+				      ifmsh->freq,
+				      ifmsh->conf->channel,
+				      ifmsh->conf->ieee80211n,
+				      ifmsh->conf->ieee80211ac,
+				      ifmsh->conf->secondary_channel,
+				      ifmsh->conf->vht_oper_chwidth,
+				      ifmsh->conf->vht_oper_centr_freq_seg0_idx,
+				      ifmsh->conf->vht_oper_centr_freq_seg1_idx,
+				      ifmsh->current_mode->vht_capab);
+
+	if (ret) {
+		wpa_printf(MSG_ERROR, "Failed to update mesh join freq params");
+		return;
+	}
+
 	wpa_msg(wpa_s, MSG_INFO, "joining mesh %s",
 		wpa_ssid_txt(params->meshid, params->meshid_len));
 	ret = wpa_drv_join_mesh(wpa_s, params);
-- 
2.10.2




More information about the Hostap mailing list