hostapd: Update to version 2.8 (2019-04-21)
[oweals/openwrt.git] / package / network / services / hostapd / patches / 016-mesh-fix-channel-switch-error-during-CAC.patch
1 From 5913d6e2a741683e7c747c046f72ca790bbe1337 Mon Sep 17 00:00:00 2001
2 From: Peter Oh <peter.oh@bowerswilkins.com>
3 Date: Mon, 27 Aug 2018 14:28:47 -0700
4 Subject: [PATCH 5/7] mesh: fix channel switch error during CAC
5
6 Mesh interface has used its channel parameters that configured
7 during its initialization even after channel switched due to
8 DFS radar detection during CAC which caused channel switch error.
9 This change fixes the error by updating its channel parameters
10 when channel's been changed from initial one.
11
12 Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
13 ---
14  wpa_supplicant/mesh.c | 25 +++++++++++++++++++++++++
15  1 file changed, 25 insertions(+)
16
17 --- a/wpa_supplicant/mesh.c
18 +++ b/wpa_supplicant/mesh.c
19 @@ -13,6 +13,7 @@
20  #include "utils/uuid.h"
21  #include "common/ieee802_11_defs.h"
22  #include "common/wpa_ctrl.h"
23 +#include "common/hw_features_common.h"
24  #include "ap/sta_info.h"
25  #include "ap/hostapd.h"
26  #include "ap/ieee802_11.h"
27 @@ -204,6 +205,30 @@ static void wpas_mesh_complete_cb(void *
28                 return;
29         }
30  
31 +       /*
32 +        * inspect if channel's been changed since initialized.
33 +        * i.e. DFS radar detection
34 +        */
35 +       if (ifmsh->freq != params->freq.freq) {
36 +               wpa_s->assoc_freq = ifmsh->freq;
37 +               ssid->frequency = ifmsh->freq;
38 +               if (hostapd_set_freq_params(&params->freq,
39 +                               ifmsh->conf->hw_mode,
40 +                               ifmsh->freq,
41 +                               ifmsh->conf->channel,
42 +                               ifmsh->conf->ieee80211n,
43 +                               ifmsh->conf->ieee80211ac,
44 +                               ifmsh->conf->secondary_channel,
45 +                               ifmsh->conf->vht_oper_chwidth,
46 +                               ifmsh->conf->vht_oper_centr_freq_seg0_idx,
47 +                               ifmsh->conf->vht_oper_centr_freq_seg1_idx,
48 +                               ifmsh->conf->vht_capab)) {
49 +                       wpa_printf(MSG_ERROR, "Error updating mesh frequency params.");
50 +                       wpa_supplicant_mesh_deinit(wpa_s);
51 +                       return;
52 +               }
53 +       }
54 +
55         if (ifmsh->mconf->security != MESH_CONF_SEC_NONE &&
56             wpas_mesh_init_rsn(wpa_s)) {
57                 wpa_printf(MSG_ERROR,