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]>
Mon, 26 Oct 2020 01:39:24 +0000 (02:39 +0100)
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 89353227c74937a43bd73d92f51bc8f61f1ef388..b8a6ee432f250eaea72cfa55d0eddc154ca91924 100644 (file)
@@ -265,6 +265,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'
@@ -344,6 +346,14 @@ append_iw_anqp_3gpp_cell_net() {
        fi
 }
 
+append_vendor_element() {
+       if [ -z "$vendor_elements" ]; then
+               vendor_elements="$1"
+       else
+               vendor_elements="$vendor_elements:$1"
+       fi
+}
+
 append_iw_anqp_elem() {
        [ -n "$1" ] && append bss_conf "anqp_elem=$1" "$N"
 }
@@ -889,6 +899,10 @@ hostapd_set_bss_options() {
                json_for_each_item append_operator_icon operator_icon
        fi
 
+       json_get_vars vendor_element
+       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"