Limiters:
02002: unlimited 0 ms burst 0
q133074 100 sl. 0 flows (1 buckets) sched 67538 weight 0 lmax 0 pri 0 droptail
sched 67538 type FIFO flags 0x0 16 buckets 0 active
02003: unlimited 0 ms burst 0
q133075 100 sl. 0 flows (1 buckets) sched 67539 weight 0 lmax 0 pri 0 droptail
sched 67539 type FIFO flags 0x0 16 buckets 0 active
02000: unlimited 0 ms burst 0
q133072 100 sl. 0 flows (1 buckets) sched 67536 weight 0 lmax 0 pri 0 droptail
sched 67536 type FIFO flags 0x0 16 buckets 0 active
02001: unlimited 0 ms burst 0
q133073 100 sl. 0 flows (1 buckets) sched 67537 weight 0 lmax 0 pri 0 droptail
sched 67537 type FIFO flags 0x0 16 buckets 0 active
After trying for a while captive portal behavior, it is working fine, These are the modifications captiveportal.inc ...
ORIGINAL FUNCTION
_function radius($username,$password,$clientip,$clientmac,$type, $radiusctx = null) {
global $g, $config;
$pipeno = captiveportal_get_next_dn_ruleno();
/* If the pool is empty, return appropriate message and fail authentication */
if (is_null($pipeno)) {
$auth_list = array();
$auth_list['auth_val'] = 1;
$auth_list['error'] = "System reached maximum login capacity";
return $auth_list;
}
$radiusservers = captiveportal_get_radius_servers();
if (is_null($radiusctx))
$radiusctx = 'first';
$auth_list = RADIUS_AUTHENTICATION($username,
$password,
$radiusservers[$radiusctx],
$clientip,
$clientmac,
$pipeno);
if ($auth_list['auth_val'] == 2) {
captiveportal_logportalauth($username,$clientmac,$clientip,$type);
$sessionid = portal_allow($clientip,
$clientmac,
$username,
$password,
$auth_list,
$pipeno,
$radiusctx);
}
return $auth_list;
}
_
MODIFIED FUNCTION
*function radius($username,$password,$clientip,$clientmac,$type, $radiusctx = null) {
global $g, $config;
$radiusservers = captiveportal_get_radius_servers();
$pipeno = captiveportal_get_next_dn_ruleno();
/* If the pool is empty, return appropriate message and fail authentication */
if (is_null($pipeno)) {
$auth_list = array();
$auth_list['auth_val'] = 1;
$auth_list['error'] = "System reached maximum login capacity";
return $auth_list;
}
if (is_null($radiusctx))
$radiusctx = 'first';
$auth_list = RADIUS_AUTHENTICATION($username,
$password,
$radiusservers[$radiusctx],
$clientip,
$clientmac,
$pipeno);
if ($auth_list['auth_val'] == 2) {
captiveportal_logportalauth($username,$clientmac,$clientip,$type);
$sessionid = portal_allow($clientip,
$clientmac,
$username,
$password,
$auth_list,
$pipeno,
$radiusctx);}
else {
captiveportal_free_dn_ruleno($pipeno);
}
return $auth_list;
}
*
In this function just changed a line position, to make the pinene began in 2000. I hope you learn the contribution.
function captiveportal_get_next_dn_ruleno($rulenos_start = 2000, $rulenos_range_max = 64500) {
global $config, $g;
$cpruleslck = lock("captiveportalrulesdn", LOCK_EX);
$ruleno = 0;
if (file_exists("{$g['vardb_path']}/captiveportaldn.rules")) {
$rules = unserialize(file_get_contents("{$g['vardb_path']}/captiveportaldn.rules"));
for ($ridx = $rulenos_start; $ridx < $rulenos_range_max; $ridx++) {
if ($rules[$ridx]) {
$ridx++;
continue;
}
$ruleno = $ridx;
$rules[$ridx] = "used";
$rules[++$ridx] = "used";
break;
}
} else {
$rules = array_pad(array(), $rulenos_range_max, false);
$ruleno = $rulenos_start;
$rules[$rulenos_start] = "used";
$rules[++$rulenos_start] = "used";
}
file_put_contents("{$g['vardb_path']}/captiveportaldn.rules", serialize($rules));
unlock($cpruleslck);
return $ruleno;
}
There is still a problem, I mean delete the file captiveportaldn.rules when the captive portal service is stoped or is restarted the server, to avoid leaving reserved the pipes that were in use. If you could do that job for me I would appreciate it. Thank's