Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
local broadcast_ssid
local channel
local country_code="$(wireless_get_reg_domain)"
+ local dfs="on"
local encryption
local key
local mode
--channel=*)
channel=$(cli_get_val "${1}")
;;
+ --dfs=*)
+ dfs="$(cli_get_val "${1}")"
+ ;;
--encryption=*)
encryption=$(cli_get_val "${1}")
;;
print "ieee80211d=1"
# Enable Radar Detection
- print "ieee80211h=1"
+ if enabled dfs; then
+ print "ieee80211h=1"
+ else
+ print "ieee80211h=0"
+ fi
print # empty line
hostapd_config_write ${port} ${config_file} \
--broadcast-ssid="${BROADCAST_SSID}" \
--channel="${CHANNEL}" \
+ --dfs="${DFS}" \
--encryption="${ENCRYPTION}" \
--key="${KEY}" \
--mode="${MODE}" \
KEY=""
SSID=
+# Perform radar detection by default when possible
+DFS="on"
+
hook_check_settings() {
assert isset ADDRESS
assert ismac ADDRESS
assert isset BROADCAST_SSID
assert isbool BROADCAST_SSID
assert isset CHANNEL
+ assert isbool DFS
assert isset MODE
assert isoneof MODE ${HOSTAPD_SUPPORTED_MODES}
assert isset PHY
--channel=*)
CHANNEL=$(cli_get_val "${1}")
;;
+ --dfs=*)
+ DFS="$(cli_get_val "${1}")"
+
+ if enabled DFS; then
+ DFS="on"
+ elif disabled DFS; then
+ DFS="off"
+ else
+ error "Invalid value for DFS: ${DFS}"
+ return ${EXIT_ERROR}
+ fi
+ ;;
--encryption=*)
ENCRYPTION=$(cli_get_val "${1}")
;;