hostapd: sync upstream (#7135)

* hostapd: make country3 option configurable

The country3 option in hostapd.conf allows the third octet of the country
string to be set. It can be used e.g. to indicate indoor or outdoor use (see
hostapd.conf for further details). Make this option configurable but optional
in OpenWrt.

Signed-off-by: Timo Sigurdsson <public_timo.s@silentcreek.de>

* hostapd: fix handling of the channel utilization options

Commit 0a7657c ("hostapd: add channel utilization as config option") added the
two new uci options bss_load_update_period and chan_util_avg_period. However,
the corresponding "config_add_int" calls for these options weren't added, so
attempting to actually use these options and change their values is bound to
fail - they always stay at their defaults. Add the missing code to actually
make these options work.

Fixes: 0a7657c ("hostapd: add channel utilization as config option")
Signed-off-by: Timo Sigurdsson <public_timo.s@silentcreek.de>

Co-authored-by: Timo Sigurdsson <public_timo.s@silentcreek.de>
This commit is contained in:
Beginner 2021-06-22 19:07:36 +08:00 committed by GitHub
parent 07863551c8
commit 2c7a6b92b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -93,7 +93,7 @@ hostapd_common_add_device_config() {
config_add_array supported_rates config_add_array supported_rates
config_add_string beacon_rate config_add_string beacon_rate
config_add_string country config_add_string country country3
config_add_boolean country_ie doth config_add_boolean country_ie doth
config_add_boolean spectrum_mgmt_required config_add_boolean spectrum_mgmt_required
config_add_int local_pwr_constraint config_add_int local_pwr_constraint
@ -119,7 +119,7 @@ hostapd_prepare_device_config() {
local base_cfg= local base_cfg=
json_get_vars country country_ie beacon_int:100 dtim_period:2 doth require_mode legacy_rates \ json_get_vars country country3 country_ie beacon_int:100 dtim_period:2 doth require_mode legacy_rates \
acs_chan_bias local_pwr_constraint spectrum_mgmt_required airtime_mode cell_density \ acs_chan_bias local_pwr_constraint spectrum_mgmt_required airtime_mode cell_density \
rts_threshold beacon_rate rssi_reject_assoc_rssi rssi_ignore_probe_request maxassoc rts_threshold beacon_rate rssi_reject_assoc_rssi rssi_ignore_probe_request maxassoc
@ -134,6 +134,7 @@ hostapd_prepare_device_config() {
[ -n "$country" ] && { [ -n "$country" ] && {
append base_cfg "country_code=$country" "$N" append base_cfg "country_code=$country" "$N"
[ -n "$country3" ] && append base_cfg "country3=$country3" "$N"
[ "$country_ie" -gt 0 ] && { [ "$country_ie" -gt 0 ] && {
append base_cfg "ieee80211d=1" "$N" append base_cfg "ieee80211d=1" "$N"
@ -262,6 +263,8 @@ hostapd_common_add_bss_config() {
config_add_int acct_port config_add_int acct_port
config_add_int acct_interval config_add_int acct_interval
config_add_int bss_load_update_period chan_util_avg_period
config_add_string dae_client config_add_string dae_client
config_add_string dae_secret config_add_string dae_secret
config_add_int dae_port config_add_int dae_port