mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Ensure that the value passed to ipfw pipes is always an integer, no matter the source. Fixes #8097
This commit is contained in:
parent
947394d291
commit
7c4e07c625
@ -2103,8 +2103,9 @@ function captiveportal_reapply_attributes($cpentry, $attributes) {
|
||||
} else {
|
||||
$dwfaultbw_up = $dwfaultbw_down = 0;
|
||||
}
|
||||
$bw_up = !empty($attributes['bw_up']) ? round(intval($attributes['bw_up'])/1000, 2) : $dwfaultbw_up;
|
||||
$bw_down = !empty($attributes['bw_down']) ? round(intval($attributes['bw_down'])/1000, 2) : $dwfaultbw_down;
|
||||
/* pipe throughputs must always be an integer, enforce that restriction again here. */
|
||||
$bw_up = round(!empty($attributes['bw_up']) ? intval($attributes['bw_up'])/1000 : $dwfaultbw_up, 0);
|
||||
$bw_down = round(!empty($attributes['bw_down']) ? intval($attributes['bw_down'])/1000 : $dwfaultbw_down, 0);
|
||||
$bw_up_pipeno = $cpentry[1];
|
||||
$bw_down_pipeno = $cpentry[1]+1;
|
||||
|
||||
@ -2249,8 +2250,9 @@ function portal_allow($clientip, $clientmac, $username, $password = null, $attri
|
||||
} else {
|
||||
$dwfaultbw_up = $dwfaultbw_down = 0;
|
||||
}
|
||||
$bw_up = !empty($attributes['bw_up']) ? round(intval($attributes['bw_up'])/1000, 2) : $dwfaultbw_up;
|
||||
$bw_down = !empty($attributes['bw_down']) ? round(intval($attributes['bw_down'])/1000, 2) : $dwfaultbw_down;
|
||||
/* pipe throughputs must always be an integer, enforce that restriction again here. */
|
||||
$bw_up = round(!empty($attributes['bw_up']) ? intval($attributes['bw_up'])/1000 : $dwfaultbw_up, 0);
|
||||
$bw_down = round(!empty($attributes['bw_down']) ? intval($attributes['bw_down'])/1000 : $dwfaultbw_down, 0);
|
||||
|
||||
if ($passthrumac) {
|
||||
$mac = array();
|
||||
|
||||
@ -3613,7 +3613,8 @@ class dnpipe_class extends dummynet_class {
|
||||
foreach ($config['schedules']['schedule'] as $schedule) {
|
||||
if ($bw['bwsched'] == $schedule['name']) {
|
||||
if (filter_get_time_based_rule_status($schedule)) {
|
||||
$pfq_rule .= " bw ".trim($bw['bw']).$bw['bwscale'];
|
||||
/* pipe throughputs must always be an integer, enforce that restriction again here. */
|
||||
$pfq_rule .= " bw ".round(trim($bw['bw']),0).$bw['bwscale'];
|
||||
if (is_numeric($bw['burst']) && ($bw['burst'] > 0)) {
|
||||
$pfq_rule .= " burst ".trim($bw['burst']);
|
||||
}
|
||||
@ -3628,7 +3629,8 @@ class dnpipe_class extends dummynet_class {
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
$pfq_rule .= " bw ".trim($bw['bw']).$bw['bwscale'];
|
||||
/* pipe throughputs must always be an integer, enforce that restriction again here. */
|
||||
$pfq_rule .= " bw ".round(trim($bw['bw']), 0).$bw['bwscale'];
|
||||
if (is_numeric($bw['burst']) && ($bw['burst'] > 0)) {
|
||||
$pfq_rule .= " burst ".trim($bw['burst']);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user