c96e8107698d7fbed8c89c5f55b7ae4301470c7e
[openwrt/staging/mkresin.git] / package / network / services / hostapd / patches / 003-mesh-relocate-RSN-init-function.patch
1 From 07bad5f256cbe8a4b45d32c5b43b870ee815fb42 Mon Sep 17 00:00:00 2001
2 From: Peter Oh <peter.oh@bowerswilkins.com>
3 Date: Tue, 29 May 2018 14:39:07 -0700
4 Subject: [PATCH 03/18] mesh: relocate RSN init function
5
6 RSN init function should work together with mesh join
7 when it's used. Since mesh join could be called at different stage
8 if DFS channel is used, relocate the function to mesh join.
9 It is still the same call flows of mesh join before this changes
10 if non-DFS channels are used, hence no side effect will occur.
11
12 Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
13 ---
14 wpa_supplicant/mesh.c | 9 ++++++---
15 1 file changed, 6 insertions(+), 3 deletions(-)
16
17 --- a/wpa_supplicant/mesh.c
18 +++ b/wpa_supplicant/mesh.c
19 @@ -336,9 +336,6 @@ static int wpa_supplicant_mesh_init(stru
20 return -1;
21 }
22
23 - if (wpas_mesh_init_rsn(wpa_s))
24 - goto out_free;
25 -
26 wpa_supplicant_conf_ap_ht(wpa_s, ssid, conf);
27
28 return 0;
29 @@ -384,6 +381,12 @@ void wpas_join_mesh(struct wpa_supplican
30 struct wpa_ssid *ssid = wpa_s->current_ssid;
31 int ret = 0;
32
33 + if (wpas_mesh_init_rsn(wpa_s)) {
34 + wpa_printf(MSG_ERROR, "Init RSN failed. Deinit mesh...");
35 + wpa_supplicant_mesh_deinit(wpa_s);
36 + return;
37 + }
38 +
39 if (ssid->key_mgmt & WPA_KEY_MGMT_SAE) {
40 wpa_s->pairwise_cipher = wpa_s->mesh_rsn->pairwise_cipher;
41 wpa_s->group_cipher = wpa_s->mesh_rsn->group_cipher;