diff --git a/package/mac80211/files/lib/wifi/mac80211.sh b/package/mac80211/files/lib/wifi/mac80211.sh
index 4bf035e5f64a175466dc421c0c49d52e787acb3c..19b157e12dbab11c4178d5494bd82ca2158a142e 100644
--- a/package/mac80211/files/lib/wifi/mac80211.sh
+++ b/package/mac80211/files/lib/wifi/mac80211.sh
@@ -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
diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh
index d60c26f3c6857602e605f720fd249b2b32ecb355..ab4288b36204edc7d72d1d0d487327fb53576678 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() {