f1922552f679d885fe9ab1d8b08b584ec6ba0d84
[openwrt/staging/dedeckeh.git] / package / network / services / hostapd / patches / 015-mesh-do-not-use-offchan-mgmt-tx-on-DFS.patch
1 From 71e9c65a7c8af90a5fd11072062b596421316452 Mon Sep 17 00:00:00 2001
2 From: Peter Oh <peter.oh@bowerswilkins.com>
3 Date: Mon, 27 Aug 2018 14:28:46 -0700
4 Subject: [PATCH 4/7] mesh: do not set offchanok on DFS channels in non-ETSI
5
6 mac80211 does not allow mgmt tx to use off channel on
7 DFS channels in non-ETSI domain, because it will invalidate
8 CAC result on current operating channel.
9 (mac80211 commit: 34373d12f3cbb74960a73431138ef619d857996f)
10 Hence don't set offchanok for mgmt tx in case of DFS channels
11 in non-ETSI.
12
13 Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
14 ---
15 src/drivers/driver_nl80211.c | 21 ++++++++++++++++++++-
16 1 file changed, 20 insertions(+), 1 deletion(-)
17
18 --- a/src/drivers/driver_nl80211.c
19 +++ b/src/drivers/driver_nl80211.c
20 @@ -7411,6 +7411,10 @@ static int wpa_driver_nl80211_send_actio
21 int ret = -1;
22 u8 *buf;
23 struct ieee80211_hdr *hdr;
24 + struct hostapd_hw_modes *modes;
25 + int i, offchanok = 1;
26 + u16 num_modes, flags;
27 + u8 dfs_domain;
28
29 wpa_printf(MSG_DEBUG, "nl80211: Send Action frame (ifindex=%d, "
30 "freq=%u MHz wait=%d ms no_cck=%d)",
31 @@ -7435,6 +7439,21 @@ static int wpa_driver_nl80211_send_actio
32 os_memset(bss->rand_addr, 0, ETH_ALEN);
33 }
34
35 + if (is_mesh_interface(drv->nlmode)) {
36 + modes = nl80211_get_hw_feature_data(bss, &num_modes,
37 + &flags, &dfs_domain);
38 + if (dfs_domain != HOSTAPD_DFS_REGION_ETSI &&
39 + ieee80211_is_dfs(bss->freq, modes, num_modes))
40 + offchanok = 0;
41 + if (modes) {
42 + for (i = 0; i < num_modes; i++) {
43 + os_free(modes[i].channels);
44 + os_free(modes[i].rates);
45 + }
46 + os_free(modes);
47 + }
48 + }
49 +
50 if (is_ap_interface(drv->nlmode) &&
51 (!(drv->capa.flags & WPA_DRIVER_FLAGS_OFFCHANNEL_TX) ||
52 (int) freq == bss->freq || drv->device_ap_sme ||
53 @@ -7446,7 +7465,7 @@ static int wpa_driver_nl80211_send_actio
54 ret = nl80211_send_frame_cmd(bss, freq, wait_time, buf,
55 24 + data_len,
56 &drv->send_action_cookie,
57 - no_cck, 0, 1, NULL, 0);
58 + no_cck, 0, offchanok, NULL, 0);
59
60 os_free(buf);
61 return ret;