]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
mesh: Relocate RSN initialization
authorPeter Oh <peter.oh@bowerswilkins.com>
Mon, 27 Aug 2018 21:28:37 +0000 (14:28 -0700)
committerJouni Malinen <j@w1.fi>
Thu, 3 Jan 2019 10:36:34 +0000 (12:36 +0200)
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 <peter.oh@bowerswilkins.com>
wpa_supplicant/mesh.c

index b559aafb4e25d66a5c3302bacaa015fad6723319..302ef7612c1c9199f76880b93d92892698df20c7 100644 (file)
@@ -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;