From 3e483bd52451fd29a8b4147d7040791569d53559 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibaut=20VAR=C3=88NE?= Date: Tue, 23 May 2023 13:59:04 +0200 Subject: [PATCH] uspot: accounting: avoid redundant assignments 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 | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/feeds/ucentral/uspot/files/usr/share/uspot/accounting.uc b/feeds/ucentral/uspot/files/usr/share/uspot/accounting.uc index f7c7700dc..a3084a15f 100755 --- a/feeds/ucentral/uspot/files/usr/share/uspot/accounting.uc +++ b/feeds/ucentral/uspot/files/usr/share/uspot/accounting.uc @@ -177,18 +177,11 @@ function client_add(interface, mac, state) { if (state.state != 1) return; - let interval = acct_interval(interface) * 1000; - let idle = idle_timeout(interface); - let session = session_timeout(interface); let accounting = (config[interface]?.acct_server && config[interface]?.acct_secret); - let max_total = 0; - - if (state.data?.radius?.reply) { - interval = (state.data?.radius?.reply['Acct-Interim-Interval'] || acct_interval(interface)) * 1000; - idle = (state.data?.radius?.reply['Idle-Timeout'] || idle_timeout(interface)); - session = (state.data?.radius?.reply['Session-Timeout'] || session_timeout(interface)); - max_total = (state.data?.radius?.reply['ChilliSpot-Max-Total-Octets'] || 0); - } + let interval = (state.data?.radius?.reply['Acct-Interim-Interval'] || acct_interval(interface)) * 1000; + let session = (state.data?.radius?.reply['Session-Timeout'] || session_timeout(interface)); + let idle = (state.data?.radius?.reply['Idle-Timeout'] || idle_timeout(interface)); + let max_total = (state.data?.radius?.reply['ChilliSpot-Max-Total-Octets'] || 0); clients[interface][mac] = { accounting,