summarylogtreecommitdiffstats
path: root/hostapd-noscan.patch
blob: aecab68e1b9d8823c191e61f1519f111ad377329 (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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
diff -wbBur hostapd-2.9/hostapd/config_file.c hostapd-2.9.q/hostapd/config_file.c
--- hostapd-2.9/hostapd/config_file.c	2019-04-21 10:10:22.000000000 +0300
+++ hostapd-2.9.q/hostapd/config_file.c	2019-04-25 14:59:57.594749041 +0300
@@ -2879,6 +2879,8 @@
 		bss->wpa_gmk_rekey = atoi(pos);
 	} else if (os_strcmp(buf, "wpa_ptk_rekey") == 0) {
 		bss->wpa_ptk_rekey = atoi(pos);
+	} else if (os_strcmp(buf, "noscan") == 0) {
+		conf->noscan = atoi(pos);
 	} else if (os_strcmp(buf, "wpa_group_update_count") == 0) {
 		char *endp;
 		unsigned long val = strtoul(pos, &endp, 0);
@@ -3411,6 +3413,8 @@
 			bss->ieee80211w = 1;
 #endif /* CONFIG_OCV */
 #ifdef CONFIG_IEEE80211N
+	} else if (os_strcmp(buf, "noscan") == 0) {
+		conf->noscan = atoi(pos);
 	} else if (os_strcmp(buf, "ieee80211n") == 0) {
 		conf->ieee80211n = atoi(pos);
 	} else if (os_strcmp(buf, "ht_capab") == 0) {
diff -wbBur hostapd-2.9/src/ap/ap_config.h hostapd-2.9.q/src/ap/ap_config.h
--- hostapd-2.9/src/ap/ap_config.h	2019-04-21 10:10:22.000000000 +0300
+++ hostapd-2.9.q/src/ap/ap_config.h	2019-04-25 15:01:32.981414600 +0300
@@ -932,6 +932,7 @@
 
 	int ht_op_mode_fixed;
 	u16 ht_capab;
+	int noscan;
 	int ieee80211n;
 	int secondary_channel;
 	int no_pri_sec_switch;
diff -wbBur hostapd-2.9/src/ap/hw_features.c hostapd-2.9.q/src/ap/hw_features.c
--- hostapd-2.9/src/ap/hw_features.c	2019-04-21 10:10:22.000000000 +0300
+++ hostapd-2.9.q/src/ap/hw_features.c	2019-04-25 14:58:10.278083605 +0300
@@ -477,7 +477,7 @@
 	int ret;
 
 	/* Check that HT40 is used and PRI / SEC switch is allowed */
-	if (!iface->conf->secondary_channel || iface->conf->no_pri_sec_switch)
+	if (!iface->conf->secondary_channel || iface->conf->no_pri_sec_switch || iface->conf->noscan)
 		return 0;
 
 	hostapd_set_state(iface, HAPD_IFACE_HT_SCAN);
@@ -743,7 +743,7 @@
 	if (!hostapd_is_usable_chan(iface, iface->conf->channel, 1))
 		return 0;
 
-	if (!iface->conf->secondary_channel)
+	if (!iface->conf->secondary_channel || iface->conf->noscan)
 		return 1;
 
 	if (!iface->conf->ht40_plus_minus_allowed)
diff -wbBur hostapd-2.9/src/ap/ieee802_11_ht.c hostapd-2.9.q/src/ap/ieee802_11_ht.c
--- hostapd-2.9/src/ap/ieee802_11_ht.c	2019-04-21 10:10:22.000000000 +0300
+++ hostapd-2.9.q/src/ap/ieee802_11_ht.c	2019-04-25 14:58:10.278083605 +0300
@@ -252,6 +252,9 @@
 		return;
 	}
 
+	if (iface->conf->noscan)
+		return;
+
 	if (len < IEEE80211_HDRLEN + 2 + sizeof(*bc_ie)) {
 		wpa_printf(MSG_DEBUG,
 			   "Ignore too short 20/40 BSS Coexistence Management frame");
@@ -412,6 +415,9 @@
 	if (iface->current_mode->mode != HOSTAPD_MODE_IEEE80211G)
 		return;
 
+	if (iface->conf->noscan)
+		return;
+
 	wpa_printf(MSG_INFO, "HT: Forty MHz Intolerant is set by STA " MACSTR
 		   " in Association Request", MAC2STR(sta->addr));