From 1e82a24192798339393cce3a9721094e213adb77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibaut=20VAR=C3=88NE?= Date: Tue, 23 May 2023 14:13:38 +0200 Subject: [PATCH] uspot: accounting: radius_stop(): reduce args redundancy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Thibaut VARĂˆNE --- .../uspot/files/usr/share/uspot/accounting.uc | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/feeds/ucentral/uspot/files/usr/share/uspot/accounting.uc b/feeds/ucentral/uspot/files/usr/share/uspot/accounting.uc index 44fc2f54c..d157bf8ab 100755 --- a/feeds/ucentral/uspot/files/usr/share/uspot/accounting.uc +++ b/feeds/ucentral/uspot/files/usr/share/uspot/accounting.uc @@ -88,6 +88,8 @@ function radius_stop(interface, mac, payload, remove) { if (!radius_available(interface, mac)) return; debug(interface, mac, 'stopping accounting'); + payload.interface = interface; + payload.address = mac; ubus.call('spotfilter', remove ? 'client_remove' : 'client_set', payload); system('conntrack -D -s ' + clients[interface][mac].ip4addr + ' -m 2'); if (clients[interface][mac].accounting) @@ -203,17 +205,12 @@ function client_add(interface, mac, state) { function client_remove(interface, mac, reason) { syslog(interface, mac, reason); - radius_stop(interface, mac, { - interface, - address: mac - }, true); + radius_stop(interface, mac, {}, true); } function client_flush(interface, mac) { syslog(interface, mac, 'logoff event'); radius_stop(interface, mac, { - interface, - address: mac, state: 0, dns_state: 1, accounting: [], @@ -224,10 +221,8 @@ function client_flush(interface, mac) { function client_timeout(interface, mac, reason) { syslog(interface, mac, reason); radius_stop(interface, mac, { - interface, state: 0, dns_state: 1, - address: mac, accounting: [], flush: true, });