Revision b451691f
Added by Ermal LUÇI about 14 years ago
usr/local/captiveportal/radius_accounting.inc | ||
---|---|---|
56 | 56 |
$retvalue = array(); |
57 | 57 |
$nas_mac = mac_format(get_interface_mac("wan")); |
58 | 58 |
$clientmac = mac_format($clientmac); |
59 |
$nas_port = $ruleno;
|
|
59 |
$nas_port = intval($ruleno);
|
|
60 | 60 |
$radiusvendor = $config['captiveportal']['radiusvendor'] ? $config['captiveportal']['radiusvendor'] : null; |
61 | 61 |
|
62 | 62 |
switch($radiusvendor) { |
... | ... | |
171 | 171 |
$retvalue = array(); |
172 | 172 |
$nas_mac = mac_format(get_interface_mac("wan")); |
173 | 173 |
$clientmac = mac_format($clientmac); |
174 |
$nas_port = $ruleno;
|
|
174 |
$nas_port = intval($ruleno);
|
|
175 | 175 |
$radiusvendor = $config['captiveportal']['radiusvendor'] ? $config['captiveportal']['radiusvendor'] : null; |
176 | 176 |
$stop_time = (empty($stop_time)) ? time() : $stop_time; |
177 | 177 |
$session_time = $stop_time - $start_time; |
... | ... | |
233 | 233 |
// Default attributes |
234 | 234 |
$racct->putAttribute(RADIUS_SERVICE_TYPE, RADIUS_LOGIN); |
235 | 235 |
$racct->putAttribute(RADIUS_NAS_PORT_TYPE, RADIUS_ETHERNET); |
236 |
$racct->putAttribute(RADIUS_NAS_PORT, $nas_port); |
|
236 |
$racct->putAttribute(RADIUS_NAS_PORT, $nas_port, 'integer');
|
|
237 | 237 |
$racct->putAttribute(RADIUS_ACCT_SESSION_ID, $sessionid); |
238 | 238 |
|
239 | 239 |
// Extra data to identify the client and nas |
Also available in: Unified diff
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.