summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
10b359c)
Add support of mac address filter. Now 'macfilter' and 'maclist' options
can be used with mac80211.
Patch from: kentarou matsuyama <matsuyama@thinktube.com>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@25105
3c298f89-4303-0410-b956-
a3cf2f4a3e73
local ifname="$2"
cfgfile="/var/run/hostapd-$phy.conf"
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
config_get hwmode "$device" hwmode
config_get device "$vif" device
config_get country "$device" country
config_get hwmode "$device" hwmode
[ -n "$ht_capab" ] && append base_cfg "ht_capab=$ht_capab" "$N"
}
}
[ -n "$ht_capab" ] && append base_cfg "ht_capab=$ht_capab" "$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
+ }
+ cat >> "$cfgfile" <<EOF
ctrl_interface=/var/run/hostapd-$phy
driver=nl80211
wmm_ac_bk_cwmin=4
ctrl_interface=/var/run/hostapd-$phy
driver=nl80211
wmm_ac_bk_cwmin=4