From: David Bauer Date: Thu, 22 Oct 2020 00:13:05 +0000 (+0200) Subject: hostapd: allow configuration of custom vendor IEs X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=899e2deb627bfda73f88db42cf5635797236b6f3;p=openwrt%2Fstaging%2Fblocktrron.git hostapd: allow configuration of custom vendor IEs This adds the ability to configure multiple additional vendor elements for a VAP. Each vendor element is one list object of the "vendor_element" option type in UCI. Signed-off-by: David Bauer --- diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh index 8f09e26fc1..1f75b19fb1 100644 --- a/package/network/services/hostapd/files/hostapd.sh +++ b/package/network/services/hostapd/files/hostapd.sh @@ -307,6 +307,8 @@ hostapd_common_add_bss_config() { config_add_array basic_rate config_add_array supported_rates + config_add_array vendor_element + config_add_boolean sae_require_mfp config_add_string 'owe_transition_bssid:macaddr' 'owe_transition_ssid:string' @@ -371,6 +373,14 @@ hostapd_set_psk() { for_each_station hostapd_set_psk_file ${ifname} } +append_vendor_element() { + if [ -z "$vendor_elements" ]; then + vendor_elements="$1" + else + vendor_elements="$vendor_elements$1" + fi +} + append_iw_roaming_consortium() { [ -n "$1" ] && append bss_conf "roaming_consortium=$1" "$N" } @@ -973,6 +983,11 @@ hostapd_set_bss_options() { append bss_conf "$val" "$N" done + json_get_vars vendor_element + vendor_elements= + json_for_each_item append_vendor_element vendor_element + [ -n "$vendor_elements" ] && append bss_conf "vendor_elements=$vendor_elements" "$N" + bss_md5sum=$(echo $bss_conf | md5sum | cut -d" " -f1) append bss_conf "config_id=$bss_md5sum" "$N"