ratelimit: fix ratelimit for multiple bss

The function looking up the rate was leaking a local variable into the global space

Signed-off-by: John Crispin <john@phrozen.org>
This commit is contained in:
John Crispin
2022-04-19 07:40:58 +02:00
parent 9de96deca8
commit cedcbcbc2b

View File

@@ -101,6 +101,7 @@ deliface() {
found=0
find_ssid() {
local ssid
config_get ssid $1 ssid
[ "$ssid" == "$2" ] || return
found=1
@@ -119,7 +120,7 @@ addiface() {
echo -n startup > /tmp/ratelimit.$iface
sleep 2
ssid=$(ubus call network.wireless status | jsonfilter -e '@[*].interfaces[@.ifname="'"$iface"'"].config.ssid')
ssid=$(ubus call hostapd.$iface get_status | jsonfilter -e '@.ssid')
[ -z "$ssid" ] && {
rm /tmp/ratelimit.$iface
logger "ratelimit: failed to lookup ssid"