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
This commit is contained in:
Felix Fietkau
2012-12-04 12:06:40 +00:00
parent 75d0271704
commit c9250641c4
2 changed files with 21 additions and 20 deletions

View File

@@ -6,8 +6,6 @@ mac80211_hostapd_setup_base() {
local ifname="$2"
cfgfile="/var/run/hostapd-$phy.conf"
macfile="/var/run/hostapd-$phy.maclist"
[ -e "$macfile" ] && rm -f "$macfile"
config_get device "$vif" device
config_get country "$device" country
@@ -51,24 +49,6 @@ mac80211_hostapd_setup_base() {
config_get_bool country_ie "$device" country_ie "$country_ie"
[ "$country_ie" -gt 0 ] && append base_cfg "ieee80211d=1" "$N"
config_get macfilter "$vif" macfilter
case "$macfilter" in
allow)
append base_cfg "macaddr_acl=1" "$N"
append base_cfg "accept_mac_file=$macfile" "$N"
;;
deny)
append base_cfg "macaddr_acl=0" "$N"
append base_cfg "deny_mac_file=$macfile" "$N"
;;
esac
config_get maclist "$vif" maclist
[ -n "$maclist" ] && {
for mac in $maclist; do
echo "$mac" >> $macfile
done
}
local br brval brstr
[ -n "$basic_rate_list" ] && {
for br in $basic_rate_list; do

View File

@@ -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() {