X-Git-Url: https://git.archive.openwrt.org/?p=openwrt.git;a=blobdiff_plain;f=package%2Fnetwork%2Fservices%2Fhostapd%2Ffiles%2Fhostapd.sh;h=ab4288b36204edc7d72d1d0d487327fb53576678;hp=d60c26f3c6857602e605f720fd249b2b32ecb355;hb=9a191df9ced38b36105ad540b1d41be7b2549dac;hpb=ef22716113d4fb76330c9bca4103512a914ef5fd diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh index d60c26f3c6..ab4288b362 100644 --- a/package/network/services/hostapd/files/hostapd.sh +++ b/package/network/services/hostapd/files/hostapd.sh @@ -210,6 +210,27 @@ hostapd_set_bss_options() { ;; esac fi + + config_get macfilter "$vif" macfilter + macfile="/var/run/hostapd-$ifname.maclist" + [ -e "$macfile" ] && rm -f "$macfile" + + 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 + config_get maclist "$vif" maclist + [ -n "$maclist" ] && { + for mac in $maclist; do + echo "$mac" >> $macfile + done + } } hostapd_set_log_options() {