aboutsummaryrefslogtreecommitdiffstats
path: root/package/network/services/hostapd/patches/015-mesh-do-not-use-offchan-mgmt-tx-on-DFS.patch
blob: 148e90d85922357d47893d03b12ecb35fe43ae50 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
From 9423e8be0393e82c8622806a0529e47fd5583c0b Mon Sep 17 00:00:00 2001
From: Peter Oh <peter.oh@bowerswilkins.com>
Date: Tue, 29 May 2018 14:39:19 -0700
Subject: [PATCH 15/18] mesh: do not use offchan mgmt tx on DFS

Drivers don't allow mesh to use offchannel on management Tx.

Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
[daniel@makrotopia.org: adapted to changed ieee80211_is_dfs prototype]
---
 src/drivers/driver_nl80211.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -7165,6 +7165,10 @@ static int wpa_driver_nl80211_send_actio
 	struct wpa_driver_nl80211_data *drv = bss->drv;
 	int ret = -1;
 	u8 *buf;
+	int offchanok = 1;
+	u16 num_modes, flags;
+	struct hostapd_hw_modes *modes;
+	u8 dfs_domain;
 	struct ieee80211_hdr *hdr;
 
 	wpa_printf(MSG_DEBUG, "nl80211: Send Action frame (ifindex=%d, "
@@ -7189,7 +7193,11 @@ static int wpa_driver_nl80211_send_actio
 	} else {
 		os_memset(bss->rand_addr, 0, ETH_ALEN);
 	}
-
+	if (is_mesh_interface(drv->nlmode) &&
+	    (modes = nl80211_get_hw_feature_data(bss, &num_modes, &flags,
+						 &dfs_domain)) &&
+	    ieee80211_is_dfs(freq, modes, num_modes))
+		offchanok = 0;
 	if (is_ap_interface(drv->nlmode) &&
 	    (!(drv->capa.flags & WPA_DRIVER_FLAGS_OFFCHANNEL_TX) ||
 	     (int) freq == bss->freq || drv->device_ap_sme ||
@@ -7201,7 +7209,7 @@ static int wpa_driver_nl80211_send_actio
 		ret = nl80211_send_frame_cmd(bss, freq, wait_time, buf,
 					     24 + data_len,
 					     &drv->send_action_cookie,
-					     no_cck, 0, 1, NULL, 0);
+					     no_cck, 0, offchanok, NULL, 0);
 
 	os_free(buf);
 	return ret;