aboutsummaryrefslogtreecommitdiffstats
path: root/package
diff options
context:
space:
mode:
authorRaphaël Mélotte <raphael.melotte@mind.be>2020-10-07 10:08:14 +0200
committerPaul Spooren <mail@aparcar.org>2021-06-23 14:52:16 -1000
commitacdb7c38c6f4411f5d2e96b45fff942505de58d1 (patch)
treed05bf1e2190b63d691e1bca0ae22b67b5e09a07c /package
parent8af62ede189aa504135db05474d34c9f8a1ed35d (diff)
downloadupstream-acdb7c38c6f4411f5d2e96b45fff942505de58d1.tar.gz
upstream-acdb7c38c6f4411f5d2e96b45fff942505de58d1.tar.bz2
upstream-acdb7c38c6f4411f5d2e96b45fff942505de58d1.zip
hostapd: add default_disabled option to the supplicant
With the default configuration we generate, the supplicant starts scanning and tries to connect to any open network when the interface is enabled. In some cases it can be desirable to prevent the supplicant from scanning by itself. For example, if on the same radio an AP is configured and an unconfigured STA is added (to be configured with WPS), the AP might not be able to beacon until the STA stops scanning. In such a case, the STA configuration can still be required to set specific settings (e.g. multi_ap_backhaul_sta) so it can't be set to "disabled" in uci (because that would prevent the supplicant from being run at all). The alternative is to add the "disabled" parameter to the default network block in the supplicant configuration. This patch adds a "default_disabled" setting in UCI which, when set, adds the "disabled" parameter to the supplicant default network block. Signed-off-by: Raphaël Mélotte <raphael.melotte@mind.be>
Diffstat (limited to 'package')
-rw-r--r--package/network/services/hostapd/files/hostapd.sh10
1 files changed, 8 insertions, 2 deletions
diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh
index 4a5f8d61fe..a32e1652ac 100644
--- a/package/network/services/hostapd/files/hostapd.sh
+++ b/package/network/services/hostapd/files/hostapd.sh
@@ -350,6 +350,7 @@ hostapd_common_add_bss_config() {
config_add_boolean multicast_to_unicast proxy_arp per_sta_vif
config_add_array hostapd_bss_options
+ config_add_boolean default_disabled
config_add_boolean request_cui
config_add_array radius_auth_req_attr
@@ -1188,7 +1189,8 @@ wpa_supplicant_add_network() {
ssid bssid key \
basic_rate mcast_rate \
ieee80211w ieee80211r \
- multi_ap
+ multi_ap \
+ default_disabled
case "$auth_type" in
sae|owe|eap192|eap-eap192)
@@ -1201,6 +1203,7 @@ wpa_supplicant_add_network() {
set_default ieee80211r 0
set_default multi_ap 0
+ set_default default_disabled 0
local key_mgmt='NONE'
local network_data=
@@ -1232,7 +1235,10 @@ wpa_supplicant_add_network() {
scan_ssid=""
}
- [ "$multi_ap" = 1 -a "$_w_mode" = "sta" ] && append network_data "multi_ap_backhaul_sta=1" "$N$T"
+ [ "$_w_mode" = "sta" ] && {
+ [ "$multi_ap" = 1 ] && append network_data "multi_ap_backhaul_sta=1" "$N$T"
+ [ "$default_disabled" = 1 ] && append network_data "disabled=1" "$N$T"
+ }
case "$auth_type" in
none) ;;