mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-11-01 19:07:47 +00:00
* properly pass current firmware hash to the gateway * revert lldp downgrade patch * update ucentral-client - fixes zlib/b64 error * add radius disctionary to ucentral-defaults * several additional hostapd patches Signed-off-by: John Crispin <john@phrozen.org>
254 lines
10 KiB
Diff
254 lines
10 KiB
Diff
From 1dc0dfaf92236247d6d0535d56687d7b1aa032c1 Mon Sep 17 00:00:00 2001
|
|
From: John Crispin <john@phrozen.org>
|
|
Date: Thu, 29 Apr 2021 10:51:46 +0200
|
|
Subject: [PATCH 2/2] hostapd: add more options
|
|
|
|
Signed-off-by: John Crispin <john@phrozen.org>
|
|
---
|
|
.../network/services/hostapd/files/hostapd.sh | 20 +++-
|
|
..._request-ignore-when-rssi-is-too-low.patch | 65 ++++++++++++
|
|
.../hostapd/patches/803-max-sta-limit.patch | 100 ++++++++++++++++++
|
|
3 files changed, 184 insertions(+), 1 deletion(-)
|
|
create mode 100644 package/network/services/hostapd/patches/802-probe_request-ignore-when-rssi-is-too-low.patch
|
|
create mode 100644 package/network/services/hostapd/patches/803-max-sta-limit.patch
|
|
|
|
diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh
|
|
index eaff318c97..923f57a33d 100644
|
|
--- a/package/network/services/hostapd/files/hostapd.sh
|
|
+++ b/package/network/services/hostapd/files/hostapd.sh
|
|
@@ -49,6 +49,7 @@ hostapd_append_wpa_key_mgmt() {
|
|
eap192)
|
|
append wpa_key_mgmt "WPA-EAP-SUITE-B-192"
|
|
[ "${ieee80211r:-0}" -gt 0 ] && append wpa_key_mgmt "FT-EAP"
|
|
+ [ "${ieee80211w:-0}" -gt 0 ] && append wpa_key_mgmt "WPA-EAP-SHA256"
|
|
;;
|
|
eap-eap192)
|
|
append wpa_key_mgmt "WPA-EAP-SUITE-B-192"
|
|
@@ -344,6 +345,11 @@ hostapd_common_add_bss_config() {
|
|
|
|
config_add_int eap_server
|
|
config_add_string eap_user_file ca_cert server_cert private_key private_key_passwd server_id
|
|
+
|
|
+ config_add_int beacon_rate
|
|
+ config_add_int rssi_reject_assoc_rssi
|
|
+ config_add_int rssi_ignore_probe_request
|
|
+ config_add_boolean multicast_to_unicast proxy_arp
|
|
}
|
|
|
|
hostapd_set_vlan_file() {
|
|
@@ -511,7 +517,9 @@ hostapd_set_bss_options() {
|
|
multi_ap multi_ap_backhaul_ssid multi_ap_backhaul_key skip_inactivity_poll \
|
|
airtime_bss_weight airtime_bss_limit airtime_sta_weight \
|
|
multicast_to_unicast per_sta_vif rts_threshold \
|
|
- eap_server eap_user_file ca_cert server_cert private_key private_key_passwd server_id
|
|
+ eap_server eap_user_file ca_cert server_cert private_key private_key_passwd server_id \
|
|
+ rssi_reject_assoc_rssi rssi_ignore_probe_request \
|
|
+ beacon_rate proxy_arp multicast_to_unicast
|
|
|
|
set_default isolate 0
|
|
set_default maxassoc 0
|
|
@@ -534,6 +542,10 @@ hostapd_set_bss_options() {
|
|
set_default airtime_bss_limit 0
|
|
set_default rts_threshold -1
|
|
set_default eap_server 0
|
|
+ set_default proxy_arp 0
|
|
+ set_default multicast_to_unicast 0
|
|
+ set_default rssi_reject_assoc_rssi 0
|
|
+ set_default rssi_ignore_probe_request 0
|
|
|
|
append bss_conf "ctrl_interface=/var/run/hostapd"
|
|
if [ "$isolate" -gt 0 ]; then
|
|
@@ -562,6 +574,12 @@ hostapd_set_bss_options() {
|
|
append bss_conf "multi_ap=$multi_ap" "$N"
|
|
append bss_conf "rts_threshold=$rts_threshold" "$N"
|
|
|
|
+ [ -n "$rssi_reject_assoc_rssi" ] && append bss_conf "rssi_reject_assoc_rssi=$rssi_reject_assoc_rssi" "$N"
|
|
+ [ -n "$rssi_ignore_probe_request" ] && append bss_conf "rssi_ignore_probe_request=$rssi_ignore_probe_request" "$N"
|
|
+ [ -n "$beacon_rate" ] && append bss_conf "beacon_rate=$beacon_rate" "$N"
|
|
+ [ -n "$proxy_arp" ] && append bss_conf "proxy_arp=$proxy_arp" "$N"
|
|
+ [ -n "$multicast_to_unicast" ] && append bss_conf "multicast_to_unicast=$multicast_to_unicast" "$N"
|
|
+
|
|
[ "$tdls_prohibit" -gt 0 ] && append bss_conf "tdls_prohibit=$tdls_prohibit" "$N"
|
|
|
|
[ "$wpa" -gt 0 ] && {
|
|
diff --git a/package/network/services/hostapd/patches/802-probe_request-ignore-when-rssi-is-too-low.patch b/package/network/services/hostapd/patches/802-probe_request-ignore-when-rssi-is-too-low.patch
|
|
new file mode 100644
|
|
index 0000000000..eecfdcc388
|
|
--- /dev/null
|
|
+++ b/package/network/services/hostapd/patches/802-probe_request-ignore-when-rssi-is-too-low.patch
|
|
@@ -0,0 +1,65 @@
|
|
+From e15b04870a7d7517a9b129d8d5cbebe6b8a25cb8 Mon Sep 17 00:00:00 2001
|
|
+From: John Crispin <john@phrozen.org>
|
|
+Date: Wed, 29 Jul 2020 17:38:15 +0200
|
|
+Subject: [PATCH 1/2] probe_request: ignore when rssi is too low
|
|
+
|
|
+Signed-off-by: John Crispin <john@phrozen.org>
|
|
+---
|
|
+ hostapd/config_file.c | 2 ++
|
|
+ src/ap/ap_config.c | 1 +
|
|
+ src/ap/ap_config.h | 1 +
|
|
+ src/ap/beacon.c | 4 ++++
|
|
+ 4 files changed, 8 insertions(+)
|
|
+
|
|
+Index: hostapd-2020-06-08-5a8b3662/hostapd/config_file.c
|
|
+===================================================================
|
|
+--- hostapd-2020-06-08-5a8b3662.orig/hostapd/config_file.c
|
|
++++ hostapd-2020-06-08-5a8b3662/hostapd/config_file.c
|
|
+@@ -4552,6 +4552,8 @@ static int hostapd_config_fill(struct ho
|
|
+ conf->rssi_reject_assoc_rssi = atoi(pos);
|
|
+ } else if (os_strcmp(buf, "rssi_reject_assoc_timeout") == 0) {
|
|
+ conf->rssi_reject_assoc_timeout = atoi(pos);
|
|
++ } else if (os_strcmp(buf, "rssi_ignore_probe_request") == 0) {
|
|
++ conf->rssi_ignore_probe_request = atoi(pos);
|
|
+ } else if (os_strcmp(buf, "pbss") == 0) {
|
|
+ bss->pbss = atoi(pos);
|
|
+ } else if (os_strcmp(buf, "transition_disable") == 0) {
|
|
+Index: hostapd-2020-06-08-5a8b3662/src/ap/ap_config.c
|
|
+===================================================================
|
|
+--- hostapd-2020-06-08-5a8b3662.orig/src/ap/ap_config.c
|
|
++++ hostapd-2020-06-08-5a8b3662/src/ap/ap_config.c
|
|
+@@ -277,6 +277,7 @@ struct hostapd_config * hostapd_config_d
|
|
+
|
|
+ conf->rssi_reject_assoc_rssi = 0;
|
|
+ conf->rssi_reject_assoc_timeout = 30;
|
|
++ conf->rssi_ignore_probe_request = 0;
|
|
+
|
|
+ #ifdef CONFIG_AIRTIME_POLICY
|
|
+ conf->airtime_update_interval = AIRTIME_DEFAULT_UPDATE_INTERVAL;
|
|
+Index: hostapd-2020-06-08-5a8b3662/src/ap/ap_config.h
|
|
+===================================================================
|
|
+--- hostapd-2020-06-08-5a8b3662.orig/src/ap/ap_config.h
|
|
++++ hostapd-2020-06-08-5a8b3662/src/ap/ap_config.h
|
|
+@@ -1051,6 +1051,7 @@ struct hostapd_config {
|
|
+
|
|
+ int rssi_reject_assoc_rssi;
|
|
+ int rssi_reject_assoc_timeout;
|
|
++ int rssi_ignore_probe_request;
|
|
+
|
|
+ #ifdef CONFIG_AIRTIME_POLICY
|
|
+ enum {
|
|
+Index: hostapd-2020-06-08-5a8b3662/src/ap/beacon.c
|
|
+===================================================================
|
|
+--- hostapd-2020-06-08-5a8b3662.orig/src/ap/beacon.c
|
|
++++ hostapd-2020-06-08-5a8b3662/src/ap/beacon.c
|
|
+@@ -821,6 +821,10 @@ void handle_probe_req(struct hostapd_dat
|
|
+ .elems = &elems,
|
|
+ };
|
|
+
|
|
++ if (hapd->iconf->rssi_ignore_probe_request && ssi_signal &&
|
|
++ ssi_signal < hapd->iconf->rssi_ignore_probe_request)
|
|
++ return;
|
|
++
|
|
+ if (len < IEEE80211_HDRLEN)
|
|
+ return;
|
|
+ ie = ((const u8 *) mgmt) + IEEE80211_HDRLEN;
|
|
diff --git a/package/network/services/hostapd/patches/803-max-sta-limit.patch b/package/network/services/hostapd/patches/803-max-sta-limit.patch
|
|
new file mode 100644
|
|
index 0000000000..4c33d7e772
|
|
--- /dev/null
|
|
+++ b/package/network/services/hostapd/patches/803-max-sta-limit.patch
|
|
@@ -0,0 +1,100 @@
|
|
+Index: hostapd-2020-06-08-5a8b3662/hostapd/config_file.c
|
|
+===================================================================
|
|
+--- hostapd-2020-06-08-5a8b3662.orig/hostapd/config_file.c
|
|
++++ hostapd-2020-06-08-5a8b3662/hostapd/config_file.c
|
|
+@@ -2909,6 +2909,11 @@ static int hostapd_config_fill(struct ho
|
|
+ line);
|
|
+ return 1;
|
|
+ }
|
|
++ } else if (os_strcmp(buf, "global_max_num_sta") == 0) {
|
|
++ conf->global_max_num_sta = atoi(pos);
|
|
++ if (conf->global_max_num_sta < 0 ||
|
|
++ conf->global_max_num_sta > MAX_STA_COUNT)
|
|
++ conf->global_max_num_sta = MAX_STA_COUNT;
|
|
+ } else if (os_strcmp(buf, "max_num_sta") == 0) {
|
|
+ bss->max_num_sta = atoi(pos);
|
|
+ if (bss->max_num_sta < 0 ||
|
|
+Index: hostapd-2020-06-08-5a8b3662/src/ap/ap_config.c
|
|
+===================================================================
|
|
+--- hostapd-2020-06-08-5a8b3662.orig/src/ap/ap_config.c
|
|
++++ hostapd-2020-06-08-5a8b3662/src/ap/ap_config.c
|
|
+@@ -223,6 +223,8 @@ struct hostapd_config * hostapd_config_d
|
|
+
|
|
+ conf->num_bss = 1;
|
|
+
|
|
++ conf->global_max_num_sta = 0;
|
|
++
|
|
+ conf->beacon_int = 100;
|
|
+ conf->rts_threshold = -2; /* use driver default: 2347 */
|
|
+ conf->fragm_threshold = -2; /* user driver default: 2346 */
|
|
+Index: hostapd-2020-06-08-5a8b3662/src/ap/ap_config.h
|
|
+===================================================================
|
|
+--- hostapd-2020-06-08-5a8b3662.orig/src/ap/ap_config.h
|
|
++++ hostapd-2020-06-08-5a8b3662/src/ap/ap_config.h
|
|
+@@ -1067,6 +1067,7 @@ struct hostapd_config {
|
|
+ char *config_id;
|
|
+
|
|
+ u8 notify_mgmt_frames;
|
|
++ int global_max_num_sta;
|
|
+ };
|
|
+
|
|
+
|
|
+Index: hostapd-2020-06-08-5a8b3662/src/ap/beacon.c
|
|
+===================================================================
|
|
+--- hostapd-2020-06-08-5a8b3662.orig/src/ap/beacon.c
|
|
++++ hostapd-2020-06-08-5a8b3662/src/ap/beacon.c
|
|
+@@ -1030,7 +1030,8 @@ void handle_probe_req(struct hostapd_dat
|
|
+ if (hapd->conf->no_probe_resp_if_max_sta &&
|
|
+ is_multicast_ether_addr(mgmt->da) &&
|
|
+ is_multicast_ether_addr(mgmt->bssid) &&
|
|
+- hapd->num_sta >= hapd->conf->max_num_sta &&
|
|
++ hapd_check_max_sta(hapd) &&
|
|
++// hapd->num_sta >= hapd->conf->max_num_sta &&
|
|
+ !ap_get_sta(hapd, mgmt->sa)) {
|
|
+ wpa_printf(MSG_MSGDUMP, "%s: Ignore Probe Request from " MACSTR
|
|
+ " since no room for additional STA",
|
|
+Index: hostapd-2020-06-08-5a8b3662/src/ap/sta_info.c
|
|
+===================================================================
|
|
+--- hostapd-2020-06-08-5a8b3662.orig/src/ap/sta_info.c
|
|
++++ hostapd-2020-06-08-5a8b3662/src/ap/sta_info.c
|
|
+@@ -682,7 +682,8 @@ struct sta_info * ap_sta_add(struct host
|
|
+ return sta;
|
|
+
|
|
+ wpa_printf(MSG_DEBUG, " New STA");
|
|
+- if (hapd->num_sta >= hapd->conf->max_num_sta) {
|
|
++ if (hapd_check_max_sta(hapd)) {
|
|
++// if (hapd->num_sta >= hapd->conf->max_num_sta) {
|
|
+ /* FIX: might try to remove some old STAs first? */
|
|
+ wpa_printf(MSG_DEBUG, "no more room for new STAs (%d/%d)",
|
|
+ hapd->num_sta, hapd->conf->max_num_sta);
|
|
+Index: hostapd-2020-06-08-5a8b3662/src/ap/hostapd.c
|
|
+===================================================================
|
|
+--- hostapd-2020-06-08-5a8b3662.orig/src/ap/hostapd.c
|
|
++++ hostapd-2020-06-08-5a8b3662/src/ap/hostapd.c
|
|
+@@ -3776,3 +3776,15 @@ void hostapd_ocv_check_csa_sa_query(void
|
|
+ }
|
|
+ }
|
|
+ #endif /* CONFIG_OCV */
|
|
++
|
|
++int hapd_check_max_sta(struct hostapd_data *hapd)
|
|
++{
|
|
++ int cnt = 0, i;
|
|
++
|
|
++ if (!hapd->iconf->global_max_num_sta)
|
|
++ return hapd->num_sta >= hapd->conf->max_num_sta;
|
|
++
|
|
++ for (i = 0; i < hapd->iface->num_bss; i++)
|
|
++ cnt += hapd->iface->bss[i]->num_sta;
|
|
++ return cnt >= hapd->iconf->global_max_num_sta;
|
|
++}
|
|
+Index: hostapd-2020-06-08-5a8b3662/src/ap/hostapd.h
|
|
+===================================================================
|
|
+--- hostapd-2020-06-08-5a8b3662.orig/src/ap/hostapd.h
|
|
++++ hostapd-2020-06-08-5a8b3662/src/ap/hostapd.h
|
|
+@@ -689,4 +689,6 @@ void fst_hostapd_fill_iface_obj(struct h
|
|
+ struct fst_wpa_obj *iface_obj);
|
|
+ #endif /* CONFIG_FST */
|
|
+
|
|
++int hapd_check_max_sta(struct hostapd_data *hapd);
|
|
++
|
|
+ #endif /* HOSTAPD_H */
|
|
--
|
|
2.25.1
|
|
|