mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-10-29 09:32:34 +00:00
uspot: accounting: local config overrides Acct-Interim-Interval
Per RFC: https://www.rfc-editor.org/rfc/rfc2869.html#section-2.1 It is also possible to statically configure an interim value on the NAS itself. Note that a locally configured value on the NAS MUST override the value found in an Access-Accept. Don't start the interim reporting timer if no interval is configured. Also add the config option to the documented config template Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
This commit is contained in:
committed by
John Crispin
parent
4c272fe5f5
commit
866583625b
@@ -18,6 +18,7 @@ config webroot def_captive
|
|||||||
# option acct_port '1812' # radius accounting server port
|
# option acct_port '1812' # radius accounting server port
|
||||||
# option acct_secret '' # radius accounting server password
|
# option acct_secret '' # radius accounting server password
|
||||||
# option acct_proxy '' # radius accounting server proxy
|
# option acct_proxy '' # radius accounting server proxy
|
||||||
|
# option acct_interval '' # radius accounting interim interval override
|
||||||
# option nasid '' # radius NAS-Identitifer, UAM '&nasid='
|
# option nasid '' # radius NAS-Identitifer, UAM '&nasid='
|
||||||
# option nasmac '' # radius Called-Station, UAM '&called='
|
# option nasmac '' # radius Called-Station, UAM '&called='
|
||||||
# option mac_format '' # MAC format specifier: 'aabbccddeeff', 'aa-bb-cc-dd-ee-ff', 'aa:bb:cc:dd:ee:ff' or the equivalent uppercase
|
# option mac_format '' # MAC format specifier: 'aabbccddeeff', 'aa-bb-cc-dd-ee-ff', 'aa:bb:cc:dd:ee:ff' or the equivalent uppercase
|
||||||
|
|||||||
@@ -117,8 +117,9 @@ function client_add(interface, mac, state) {
|
|||||||
|
|
||||||
let accounting = (config[interface].acct_server && config[interface].acct_secret);
|
let accounting = (config[interface].acct_server && config[interface].acct_secret);
|
||||||
|
|
||||||
defval = config[interface].acct_interval || 600;
|
// RFC: NAS local interval value *must* override RADIUS attribute
|
||||||
let interval = (state.data?.radius?.reply['Acct-Interim-Interval'] || defval) * 1000;
|
defval = config[interface].acct_interval;
|
||||||
|
let interval = (defval || state.data?.radius?.reply['Acct-Interim-Interval'] || 0) * 1000;
|
||||||
|
|
||||||
defval = config[interface].session_timeout || 0;
|
defval = config[interface].session_timeout || 0;
|
||||||
let session = (state.data?.radius?.reply['Session-Timeout'] || defval);
|
let session = (state.data?.radius?.reply['Session-Timeout'] || defval);
|
||||||
@@ -141,7 +142,7 @@ function client_add(interface, mac, state) {
|
|||||||
clients[interface][mac].ip6addr = state.ip6addr;
|
clients[interface][mac].ip6addr = state.ip6addr;
|
||||||
if (state.data?.radius?.request) {
|
if (state.data?.radius?.request) {
|
||||||
clients[interface][mac].radius = state.data.radius.request;
|
clients[interface][mac].radius = state.data.radius.request;
|
||||||
if (accounting)
|
if (accounting && interval)
|
||||||
clients[interface][mac].timeout = uloop.timer(interval, () => radius_interim(interface, mac));
|
clients[interface][mac].timeout = uloop.timer(interval, () => radius_interim(interface, mac));
|
||||||
}
|
}
|
||||||
syslog(interface, mac, 'adding client');
|
syslog(interface, mac, 'adding client');
|
||||||
|
|||||||
Reference in New Issue
Block a user