mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-10-30 01:52:51 +00:00
ratelimit: apply updated ratelimit to associated stations
Fixes: WIFI-13453 Fixes: WIFI-13840 Signed-off-by: John Crispin <john@phrozen.org>
This commit is contained in:
@@ -18,6 +18,7 @@ reload_service() {
|
|||||||
ubus call ratelimit flush
|
ubus call ratelimit flush
|
||||||
config_load ratelimit
|
config_load ratelimit
|
||||||
config_foreach add_rate rate
|
config_foreach add_rate rate
|
||||||
|
ubus call ratelimit reload
|
||||||
}
|
}
|
||||||
|
|
||||||
service_triggers() {
|
service_triggers() {
|
||||||
|
|||||||
@@ -326,6 +326,33 @@ function run_service() {
|
|||||||
args: {
|
args: {
|
||||||
device:"",
|
device:"",
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
reload: {
|
||||||
|
call: function(req) {
|
||||||
|
let list = uctx.list();
|
||||||
|
for (let obj in list) {
|
||||||
|
if (!wildcard(obj, 'hostapd.wlan*'))
|
||||||
|
continue;
|
||||||
|
let iface = split(obj, '.')[1];
|
||||||
|
let device = devices[iface];
|
||||||
|
if (!device)
|
||||||
|
continue;
|
||||||
|
let status = uctx.call(obj, 'get_status');
|
||||||
|
if (!status?.ssid)
|
||||||
|
continue;
|
||||||
|
if (!defaults[status?.ssid])
|
||||||
|
continue;
|
||||||
|
let data = {
|
||||||
|
rate_ingress: defaults[status?.ssid][0],
|
||||||
|
rate_egress: defaults[status?.ssid][1]
|
||||||
|
};
|
||||||
|
for (let k, client in device.clients)
|
||||||
|
set_client(device, client, data);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
},
|
||||||
|
args: {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user