X-Git-Url: https://git.archive.openwrt.org/?p=openwrt.git;a=blobdiff_plain;f=package%2Fnetwork%2Fservices%2Fhostapd%2Ffiles%2Fhostapd.sh;h=8d6f30538d3fdefb2642a6c0534875e961855c2c;hp=d60c26f3c6857602e605f720fd249b2b32ecb355;hb=d6c58ab4df263261596dd91b6f401761b77e9954;hpb=9c8997d54dc9df184bfcedeabf0b3c85cf5e6753 diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh index d60c26f3c6..8d6f30538d 100644 --- a/package/network/services/hostapd/files/hostapd.sh +++ b/package/network/services/hostapd/files/hostapd.sh @@ -12,6 +12,7 @@ hostapd_set_bss_options() { config_get_bool disassoc_low_ack "$vif" disassoc_low_ack 1 config_get max_num_sta "$vif" max_num_sta 0 config_get max_inactivity "$vif" max_inactivity 0 + config_get_bool preamble "$vif" short_preamble 1 config_get device "$vif" device config_get hwmode "$device" hwmode @@ -29,6 +30,9 @@ hostapd_set_bss_options() { append "$var" "ap_max_inactivity=$max_inactivity" "$N" fi append "$var" "disassoc_low_ack=$disassoc_low_ack" "$N" + if [ "$preamble" -gt 0 ]; then + append "$var" "preamble=$preamble" "$N" + fi # Examples: # psk-mixed/tkip => WPA1+2 PSK, TKIP @@ -210,6 +214,42 @@ hostapd_set_bss_options() { ;; esac fi + + config_get macfile "$vif" macfile + config_get maclist "$vif" maclist + if [ -z "$macfile" ] + then + # if no macfile has been specified, fallback to the default name + macfile="/var/run/hostapd-$ifname.maclist" + else + if [ -n "$maclist" ] + then + # to avoid to overwrite the original file, make a copy + # before appending the entries specified by the maclist + # option + cp $macfile $macfile.maclist + macfile=$macfile.maclist + fi + fi + + if [ -n "$maclist" ] + then + for mac in $maclist; do + echo "$mac" >> $macfile + done + fi + + config_get macfilter "$vif" macfilter + case "$macfilter" in + allow) + append "$var" "macaddr_acl=1" "$N" + append "$var" "accept_mac_file=$macfile" "$N" + ;; + deny) + append "$var" "macaddr_acl=0" "$N" + append "$var" "deny_mac_file=$macfile" "$N" + ;; + esac } hostapd_set_log_options() {