hostapd: fix basic rate list handling with netifd
[openwrt.git] / package / network / services / hostapd / files / netifd.sh
index 930755f..0c73aa7 100644 (file)
@@ -6,6 +6,12 @@ hostapd_add_rate() {
        [ $sub -gt 0 ] && append $var "."
 }
 
+hostapd_add_basic_rate() {
+       local var="$1"
+       local val="$(($2 / 100))"
+       append $var "$val" " "
+}
+
 hostapd_append_wep_key() {
        local var="$1"
 
@@ -69,8 +75,9 @@ hostapd_prepare_device_config() {
        [ -n "$hwmode" ] && append base_cfg "hw_mode=$hwmode" "$N"
 
        local brlist= br
+       json_get_values basic_rate_list basic_rate
        for br in $basic_rate_list; do
-               hostapd_add_rate brlist "$br"
+               hostapd_add_basic_rate brlist "$br"
        done
        [ -n "$brlist" ] && append base_cfg "basic_rates=$brlist" "$N"
        [ -n "$beacon_int" ] && append base_cfg "beacon_int=$beacon_int" "$N"
@@ -294,7 +301,7 @@ hostapd_set_bss_options() {
                [ "$auth_cache" = 0 ] && append bss_conf "disable_pmksa_caching=1" "$N"
 
                # RSN -> allow management frame protection
-               json_get_var ieee80211w
+               json_get_var ieee80211w ieee80211w
                case "$ieee80211w" in
                        [012])
                                json_get_vars ieee80211w_max_timeout ieee80211w_retry_timeout