mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-10-30 01:52:51 +00:00
uspot: accounting: correctly handle ipv4/v6 conntrack
Only run conntrack deletion on defined client IP(s) and process both IPv4 and IPv6. Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
This commit is contained in:
committed by
John Crispin
parent
a9df4b8549
commit
f1c4a39540
@@ -189,7 +189,11 @@ function client_kick(interface, mac, remove) {
|
||||
};
|
||||
|
||||
ubus.call('spotfilter', remove ? 'client_remove' : 'client_set', payload);
|
||||
system('conntrack -D -s ' + clients[interface][mac].ip4addr + ' -m 2');
|
||||
|
||||
if (clients[interface][mac].ip4addr)
|
||||
system('conntrack -D -s ' + clients[interface][mac].ip4addr + ' -m 2');
|
||||
if (clients[interface][mac].ip6addr)
|
||||
system('conntrack -D -s ' + clients[interface][mac].ip6addr + ' -m 2');
|
||||
|
||||
if (clients[interface][mac].accounting)
|
||||
clients[interface][mac].timeout.cancel();
|
||||
|
||||
Reference in New Issue
Block a user