aboutsummaryrefslogtreecommitdiffstats
path: root/package/network/services/hostapd
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2012-12-04 12:06:40 +0000
committerFelix Fietkau <nbd@openwrt.org>2012-12-04 12:06:40 +0000
commitc9250641c4f4e172d859e1fb0e9a76631ff13d87 (patch)
treeaf11d75dc85bd0ca03d63b0d034b1dc09192152b /package/network/services/hostapd
parent75d0271704be302f4d77da650e55152713be07de (diff)
downloadupstream-c9250641c4f4e172d859e1fb0e9a76631ff13d87.tar.gz
upstream-c9250641c4f4e172d859e1fb0e9a76631ff13d87.tar.bz2
upstream-c9250641c4f4e172d859e1fb0e9a76631ff13d87.zip
mac80211, hostapd: Fix macfilter for multi bssid setups
Previously only the first macfilter configuration would have been used on all interfaces. However, the configuration was always done per vif already. Hence, move the macfilter setup into hostapd.sh where and create one mac list file per vif. Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@34470 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/network/services/hostapd')
-rw-r--r--package/network/services/hostapd/files/hostapd.sh21
1 files changed, 21 insertions, 0 deletions
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() {