summaryrefslogtreecommitdiffstats
path: root/usr/local/captiveportal
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2011-07-15 08:01:52 +0000
committerErmal <eri@pfsense.org>2011-07-15 08:02:20 +0000
commitb451691f08e5615158b04c767bc6c7cb876bc913 (patch)
treeba8aa60e6426a8aa848e94749ce8a0f0b94b90d0 /usr/local/captiveportal
parent59d15836d880feb1e4bade2cdd8046a1f8ceb86a (diff)
downloadpfsense-b451691f08e5615158b04c767bc6c7cb876bc913.zip
pfsense-b451691f08e5615158b04c767bc6c7cb876bc913.tar.gz
Fixes #1618. Always convert the NAS_PORT value to int in php and pass the attribute type during encoding to guarantee that it is encoded as an integer.
Diffstat (limited to 'usr/local/captiveportal')
-rw-r--r--usr/local/captiveportal/radius_accounting.inc6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr/local/captiveportal/radius_accounting.inc b/usr/local/captiveportal/radius_accounting.inc
index 2e18979..704c229 100644
--- a/usr/local/captiveportal/radius_accounting.inc
+++ b/usr/local/captiveportal/radius_accounting.inc
@@ -56,7 +56,7 @@ function RADIUS_ACCOUNTING_START($ruleno, $username, $sessionid, $radiusservers,
$retvalue = array();
$nas_mac = mac_format(get_interface_mac("wan"));
$clientmac = mac_format($clientmac);
- $nas_port = $ruleno;
+ $nas_port = intval($ruleno);
$radiusvendor = $config['captiveportal']['radiusvendor'] ? $config['captiveportal']['radiusvendor'] : null;
switch($radiusvendor) {
@@ -171,7 +171,7 @@ function RADIUS_ACCOUNTING_STOP($ruleno,$username,$sessionid,$start_time,$radius
$retvalue = array();
$nas_mac = mac_format(get_interface_mac("wan"));
$clientmac = mac_format($clientmac);
- $nas_port = $ruleno;
+ $nas_port = intval($ruleno);
$radiusvendor = $config['captiveportal']['radiusvendor'] ? $config['captiveportal']['radiusvendor'] : null;
$stop_time = (empty($stop_time)) ? time() : $stop_time;
$session_time = $stop_time - $start_time;
@@ -233,7 +233,7 @@ function RADIUS_ACCOUNTING_STOP($ruleno,$username,$sessionid,$start_time,$radius
// Default attributes
$racct->putAttribute(RADIUS_SERVICE_TYPE, RADIUS_LOGIN);
$racct->putAttribute(RADIUS_NAS_PORT_TYPE, RADIUS_ETHERNET);
- $racct->putAttribute(RADIUS_NAS_PORT, $nas_port);
+ $racct->putAttribute(RADIUS_NAS_PORT, $nas_port, 'integer');
$racct->putAttribute(RADIUS_ACCT_SESSION_ID, $sessionid);
// Extra data to identify the client and nas
OpenPOWER on IntegriCloud