From 3375803a261bcb5f8ffbabfc973fc5d62cc482c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibaut=20VAR=C3=88NE?= Date: Wed, 24 May 2023 14:29:38 +0200 Subject: [PATCH] uspot: accounting: add_client(): fix integer types MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Thibaut VARĂˆNE --- .../ucentral/uspot/files/usr/share/uspot/accounting.uc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/feeds/ucentral/uspot/files/usr/share/uspot/accounting.uc b/feeds/ucentral/uspot/files/usr/share/uspot/accounting.uc index c4eb2b692..3fc86f88e 100755 --- a/feeds/ucentral/uspot/files/usr/share/uspot/accounting.uc +++ b/feeds/ucentral/uspot/files/usr/share/uspot/accounting.uc @@ -115,19 +115,19 @@ function client_add(interface, mac, state) { let defval = 0; - let accounting = (config[interface].acct_server && config[interface].acct_secret); + let accounting = !!(config[interface].acct_server && config[interface].acct_secret); // RFC: NAS local interval value *must* override RADIUS attribute defval = config[interface].acct_interval; - let interval = (defval || state.data?.radius?.reply['Acct-Interim-Interval'] || 0) * 1000; + let interval = +(defval || state.data?.radius?.reply['Acct-Interim-Interval'] || 0) * 1000; defval = config[interface].session_timeout || 0; - let session = (state.data?.radius?.reply['Session-Timeout'] || defval); + let session = +(state.data?.radius?.reply['Session-Timeout'] || defval); defval = config[interface].idle_timeout || 600; - let idle = (state.data?.radius?.reply['Idle-Timeout'] || defval); + let idle = +(state.data?.radius?.reply['Idle-Timeout'] || defval); - let max_total = (state.data?.radius?.reply['ChilliSpot-Max-Total-Octets'] || 0); + let max_total = +(state.data?.radius?.reply['ChilliSpot-Max-Total-Octets'] || 0); clients[interface][mac] = { accounting,