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:03:16 +0000
commite6bd231242cb43ad7e8fca8635d6adcb17f38186 (patch)
treec3271f420b95a255658a7a6a4e028eb42a746f4c /usr/local/captiveportal
parent84bc8eb79a5f03f6dfc511508b1c3a5b35f916d8 (diff)
downloadpfsense-e6bd231242cb43ad7e8fca8635d6adcb17f38186.zip
pfsense-e6bd231242cb43ad7e8fca8635d6adcb17f38186.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