summaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2010-12-14 22:59:53 +0000
committerErmal <eri@pfsense.org>2010-12-14 22:59:53 +0000
commit1d164dd444cb1af57e0adef0b0bf46be263dcf41 (patch)
tree497878a8ba3a27c31bbad2c9f3428490877a00a4 /usr
parentf5c05fcc613728bc5a18898b4799e8e5a8df7529 (diff)
downloadpfsense-1d164dd444cb1af57e0adef0b0bf46be263dcf41.zip
pfsense-1d164dd444cb1af57e0adef0b0bf46be263dcf41.tar.gz
Provide a default value to the function for converting kb/Mb to coeficient for math.
Diffstat (limited to 'usr')
-rw-r--r--usr/local/www/wizards/traffic_shaper_wizard.inc8
-rwxr-xr-xusr/local/www/wizards/traffic_shaper_wizard_dedicated.inc2
-rwxr-xr-xusr/local/www/wizards/traffic_shaper_wizard_multi_all.inc2
-rw-r--r--usr/local/www/wizards/traffic_shaper_wizard_multi_lan.inc4
4 files changed, 8 insertions, 8 deletions
diff --git a/usr/local/www/wizards/traffic_shaper_wizard.inc b/usr/local/www/wizards/traffic_shaper_wizard.inc
index 05c3671..2fa3f1b 100644
--- a/usr/local/www/wizards/traffic_shaper_wizard.inc
+++ b/usr/local/www/wizards/traffic_shaper_wizard.inc
@@ -586,7 +586,7 @@ function apply_all_choosen_items() {
$lanbw = 0;
for ($i = 0; $i < $steps; $i++) {
$down = wizard_get_bandwidthtype_scale($config['ezshaper']['step2']["conn{$i}downloadspeed"]);
- $input_bw = $config['ezshaper']['step2']["conn{$i}download"] * $down;
+ $input_bw = floatval($config['ezshaper']['step2']["conn{$i}download"]) * $down;
$lanbw += $input_bw;
}
@@ -624,7 +624,7 @@ function apply_all_choosen_items() {
if ($config['ezshaper']['step3']['enable']) {
$voip = true;
- $voipbw = $config['ezshaper']['step3']["conn{$i}upload"];
+ $voipbw = floatval($config['ezshaper']['step3']["conn{$i}upload"]);
$voipbwunit = $config['ezshaper']['step3']["conn{$i}uploadspeed"];
if ($sched != "HFSC") {
if ($voipbwunit == "%")
@@ -1504,7 +1504,7 @@ function apply_all_choosen_items() {
write_config();
}
-function wizard_get_bandwidthtype_scale($type) {
+function wizard_get_bandwidthtype_scale($type = "b") {
switch ($type) {
case "Gb":
$factor = 1000 * 1000 * 1000;
@@ -1520,7 +1520,7 @@ function wizard_get_bandwidthtype_scale($type) {
$factor = 1;
break;
}
- return floatval($factor);
+ return intval($factor);
}
?>
diff --git a/usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc b/usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc
index 50fa627..66b4716 100755
--- a/usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc
+++ b/usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc
@@ -1564,7 +1564,7 @@ function apply_all_choosen_items() {
write_config();
}
-function wizard_get_bandwidthtype_scale($type) {
+function wizard_get_bandwidthtype_scale($type = "b") {
switch ($type) {
case "Gb":
$factor = 1000 * 1000 * 1000;
diff --git a/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc b/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc
index 83c3e49..6568dc1 100755
--- a/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc
+++ b/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc
@@ -1611,7 +1611,7 @@ function apply_all_choosen_items() {
write_config();
}
-function wizard_get_bandwidthtype_scale($type) {
+function wizard_get_bandwidthtype_scale($type = "b") {
switch ($type) {
case "Gb":
$factor = 1000 * 1000 * 1000;
diff --git a/usr/local/www/wizards/traffic_shaper_wizard_multi_lan.inc b/usr/local/www/wizards/traffic_shaper_wizard_multi_lan.inc
index b5f8d63..99f5c35 100644
--- a/usr/local/www/wizards/traffic_shaper_wizard_multi_lan.inc
+++ b/usr/local/www/wizards/traffic_shaper_wizard_multi_lan.inc
@@ -1348,7 +1348,7 @@ function apply_all_choosen_items() {
write_config();
}
-function wizard_get_bandwidthtype_scale($type) {
+function wizard_get_bandwidthtype_scale($type = "b") {
switch ($type) {
case "Gb":
$factor = 1000 * 1000 * 1000;
@@ -1364,7 +1364,7 @@ function wizard_get_bandwidthtype_scale($type) {
$factor = 1;
break;
}
- return floatval($factor);
+ return intval($factor);
}
?>
OpenPOWER on IntegriCloud