From: Peter Oh Date: Mon, 27 Aug 2018 21:28:37 +0000 (-0700) Subject: mesh: Relocate RSN initialization X-Git-Tag: hostap_2_8~590 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4b5453ceddbed5f131f6422ea4e1156fd9280b8f;p=thirdparty%2Fhostap.git mesh: Relocate RSN initialization RSN initialization should work together with mesh join when it's used. Since mesh join could be called at a different stage if DFS channel is used, relocate the RSN initialization call to mesh join. It is still the same call flow of mesh join before this if non-DFS channels are used, hence no significant side effect will occur. Signed-off-by: Peter Oh --- diff --git a/wpa_supplicant/mesh.c b/wpa_supplicant/mesh.c index b559aafb4..302ef7612 100644 --- a/wpa_supplicant/mesh.c +++ b/wpa_supplicant/mesh.c @@ -203,6 +203,14 @@ static int wpas_mesh_complete(struct wpa_supplicant *wpa_s) return -1; } + if (ifmsh->mconf->security != MESH_CONF_SEC_NONE && + wpas_mesh_init_rsn(wpa_s)) { + wpa_printf(MSG_ERROR, + "mesh: RSN initialization failed - deinit mesh"); + wpa_supplicant_mesh_deinit(wpa_s); + return -1; + } + if (ssid->key_mgmt & WPA_KEY_MGMT_SAE) { wpa_s->pairwise_cipher = wpa_s->mesh_rsn->pairwise_cipher; wpa_s->group_cipher = wpa_s->mesh_rsn->group_cipher; @@ -375,9 +383,6 @@ static int wpa_supplicant_mesh_init(struct wpa_supplicant *wpa_s, return -1; } - if (mconf->security != MESH_CONF_SEC_NONE && wpas_mesh_init_rsn(wpa_s)) - goto out_free; - wpa_supplicant_conf_ap_ht(wpa_s, ssid, conf); return 0;