Skip to content
Snippets Groups Projects
Commit 541fbfbb authored by Jo-Philipp Wich's avatar Jo-Philipp Wich
Browse files

hostapd: correctly handle macfile uci option


Make hostapd.sh correctly handle the macfile uci option.

Such option specifies the macfile name to pass into the
hostapd configuration file. Moreover, if a maclist option
has been specified, copy the macfile before appending new
entries.

Signed-off-by: default avatarAntonio Quartulli <antonio@open-mesh.com>

SVN-Revision: 36944
parent dfea3bae
No related branches found
No related tags found
No related merge requests found
...@@ -215,10 +215,31 @@ hostapd_set_bss_options() { ...@@ -215,10 +215,31 @@ hostapd_set_bss_options() {
esac esac
fi fi
config_get macfilter "$vif" macfilter config_get macfile "$vif" macfile
macfile="/var/run/hostapd-$ifname.maclist" config_get maclist "$vif" maclist
[ -e "$macfile" ] && rm -f "$macfile" 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 case "$macfilter" in
allow) allow)
append "$var" "macaddr_acl=1" "$N" append "$var" "macaddr_acl=1" "$N"
...@@ -229,12 +250,6 @@ hostapd_set_bss_options() { ...@@ -229,12 +250,6 @@ hostapd_set_bss_options() {
append "$var" "deny_mac_file=$macfile" "$N" append "$var" "deny_mac_file=$macfile" "$N"
;; ;;
esac esac
config_get maclist "$vif" maclist
[ -n "$maclist" ] && {
for mac in $maclist; do
echo "$mac" >> $macfile
done
}
} }
hostapd_set_log_options() { hostapd_set_log_options() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment