hostapd: allow configuration of custom vendor IEs
authorDavid Bauer <[email protected]>
Thu, 22 Oct 2020 00:13:05 +0000 (02:13 +0200)
committerDavid Bauer <[email protected]>
Wed, 26 May 2021 09:39:36 +0000 (11:39 +0200)
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 <[email protected]>
package/network/services/hostapd/files/hostapd.sh

index 8f09e26fc131622b1ceeea7f8b64af933cf8f085..1f75b19fb1c0b1b3ddd47c4162d7bf64571c0a62 100644 (file)
@@ -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"