diff mbox series

[OpenWrt-Devel,1/2] hostapd: add dtim_period, local_pwr_constraint, spectrum_mgmt_required

Message ID mailman.9968.1573271025.2486.openwrt-devel@lists.openwrt.org
State Accepted
Delegated to: John Crispin
Headers show
Series [OpenWrt-Devel,1/2] hostapd: add dtim_period, local_pwr_constraint, spectrum_mgmt_required | expand

Commit Message

Thomas Richard via openwrt-devel Nov. 9, 2019, 3:42 a.m. UTC
The sender domain has a DMARC Reject/Quarantine policy which disallows
sending mailing list messages using the original "From" header.

To mitigate this problem, the original message has been wrapped
automatically by the mailing list software.
Allows dtim_period to be configurable, the default is from hostapd.
Adds additional regulatory tunables for power constraint and spectrum
managment.

Signed-off-by: Kyle Copperfield <kmcopper@danwin1210.me>
---
 package/network/services/hostapd/Makefile         |  2 +-
 package/network/services/hostapd/files/hostapd.sh | 13 +++++++++++--
 2 files changed, 12 insertions(+), 3 deletions(-)

Comments

John Crispin Jan. 15, 2020, 7:12 p.m. UTC | #1
Merged, thanks !
diff mbox series

Patch

diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile
index 4f6420f503..86534054b8 100644
--- a/package/network/services/hostapd/Makefile
+++ b/package/network/services/hostapd/Makefile
@@ -7,7 +7,7 @@ 
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=hostapd
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE_URL:=http://w1.fi/hostap.git
 PKG_SOURCE_PROTO:=git
diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh
index 3c1504ca60..86b9932301 100644
--- a/package/network/services/hostapd/files/hostapd.sh
+++ b/package/network/services/hostapd/files/hostapd.sh
@@ -90,6 +90,8 @@  hostapd_common_add_device_config() {
 
 	config_add_string country
 	config_add_boolean country_ie doth
+	config_add_boolean spectrum_mgmt_required
+	config_add_int local_pwr_constraint
 	config_add_string require_mode
 	config_add_boolean legacy_rates
 
@@ -106,11 +108,13 @@  hostapd_prepare_device_config() {
 	local base="${config%%.conf}"
 	local base_cfg=
 
-	json_get_vars country country_ie beacon_int:100 doth require_mode legacy_rates acs_chan_bias
+	json_get_vars country country_ie beacon_int:100 dtim_period:2 doth require_mode legacy_rates \
+		acs_chan_bias local_pwr_constraint spectrum_mgmt_required
 
 	hostapd_set_log_options base_cfg
 
 	set_default country_ie 1
+	set_default spectrum_mgmt_required 0
 	set_default doth 1
 	set_default legacy_rates 1
 
@@ -119,7 +123,11 @@  hostapd_prepare_device_config() {
 	[ -n "$country" ] && {
 		append base_cfg "country_code=$country" "$N"
 
-		[ "$country_ie" -gt 0 ] && append base_cfg "ieee80211d=1" "$N"
+		[ "$country_ie" -gt 0 ] && { 
+			append base_cfg "ieee80211d=1" "$N"
+			[ -n "$local_pwr_constraint" ] && append base_cfg "local_pwr_constraint=$local_pwr_constraint" "$N"
+			[ "$spectrum_mgmt_required" -gt 0 ] && append base_cfg "spectrum_mgmt_required=$spectrum_mgmt_required" "$N"
+		}
 		[ "$hwmode" = "a" -a "$doth" -gt 0 ] && append base_cfg "ieee80211h=1" "$N"
 	}
 
@@ -154,6 +162,7 @@  hostapd_prepare_device_config() {
 	[ -n "$rlist" ] && append base_cfg "supported_rates=$rlist" "$N"
 	[ -n "$brlist" ] && append base_cfg "basic_rates=$brlist" "$N"
 	append base_cfg "beacon_int=$beacon_int" "$N"
+	append base_cfg "dtim_period=$dtim_period" "$N"
 
 	json_get_values opts hostapd_options
 	for val in $opts; do