summaryrefslogtreecommitdiffstats
path: root/usr/local/www/wizards
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2014-07-25 09:15:54 -0300
committerRenato Botelho <garga@FreeBSD.org>2014-07-25 09:15:54 -0300
commit6141a91b4606b9fec2edf8b55e352c33a68875f8 (patch)
tree91efec213d8c7658495541e8bb660aecf98c859e /usr/local/www/wizards
parentc8f89a406b747680c3168734ad3b68978036608f (diff)
downloadpfsense-6141a91b4606b9fec2edf8b55e352c33a68875f8.zip
pfsense-6141a91b4606b9fec2edf8b55e352c33a68875f8.tar.gz
Disable bandwidth checks for PRIQ, it should fix #3537
Diffstat (limited to 'usr/local/www/wizards')
-rw-r--r--usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc116
-rw-r--r--usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc48
2 files changed, 88 insertions, 76 deletions
diff --git a/usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc b/usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc
index 4c3d202..82a2b82 100644
--- a/usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc
+++ b/usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc
@@ -285,27 +285,29 @@ function step2_stepsubmitphpaction() {
$stepid--;
return;
}
- if (!is_numeric($_POST["conn{$i}upload"])) {
- $savemsg = gettext("Upload bandwidth of connection {$i} is not valid.");
- $stepid--;
- return;
- }
- if (!is_numeric($_POST["conn{$i}download"])) {
- $savemsg = gettext("Download bandwidth of connection {$i} is not valid.");
- $stepid--;
- return;
- }
- $upbw = $_POST["conn{$i}upload"];
- $downbw = $_POST["conn{$i}download"];
- if ($upbw < 1 || $downbw < 1) {
- $savemsg = gettext("You cannot specify bandwidth smaller than 1!");
- $stepid--;
- return;
- }
- if (intval($upbw) < 128 && $_POST["conn{$i}uploadspeed"] == "Kb" && trim($_POST["conn{$i}uploadscheduler"]) == "CBQ") {
- $savemsg=gettext("Uploads smaller than 128Kbit/s is not supported for connection {$i} on CBQ scheduler.");
- $stepid--;
- return;
+ if (trim($_POST["conn{$i}uploadscheduler"]) != "PRIQ") {
+ if (!is_numeric($_POST["conn{$i}upload"])) {
+ $savemsg = gettext("Upload bandwidth of connection {$i} is not valid.");
+ $stepid--;
+ return;
+ }
+ if (!is_numeric($_POST["conn{$i}download"])) {
+ $savemsg = gettext("Download bandwidth of connection {$i} is not valid.");
+ $stepid--;
+ return;
+ }
+ $upbw = $_POST["conn{$i}upload"];
+ $downbw = $_POST["conn{$i}download"];
+ if ($upbw < 1 || $downbw < 1) {
+ $savemsg = gettext("You cannot specify bandwidth smaller than 1!");
+ $stepid--;
+ return;
+ }
+ if (intval($upbw) < 128 && $_POST["conn{$i}uploadspeed"] == "Kb" && trim($_POST["conn{$i}uploadscheduler"]) == "CBQ") {
+ $savemsg=gettext("Uploads smaller than 128Kbit/s is not supported for connection {$i} on CBQ scheduler.");
+ $stepid--;
+ return;
+ }
}
if ($_POST["local{$i}interface"] == $_POST["conn{$j}interface"] || $_POST["local{$i}interface"] == $_POST["local{$j}interface"]) {
$savemsg=gettext("You cannot select the same interface for local and outside.");
@@ -498,49 +500,53 @@ function step3_stepsubmitphpaction() {
$steps = intval($config['ezshaper']['step1']['numberofconnections']);
for ($i = 0; $i < $steps; $i++) {
- if (!is_numeric($_POST["conn{$i}upload"])) {
- $savemsg = gettext("Upload bandwidth of connection {$i} is not valid.");
- $stepid--;
- return;
- }
- if ($_POST["conn{$i}uploadspeed"] == "%") {
- if (intval($_POST["conn{$i}upload"]) > 80) {
- $savemsg=gettext("You cannot set the VoIP upload bandwidth on connection {$i} higher than 80% of the connection.");
+ if ($config['ezshaper']['step2']["conn{$i}uploadscheduler"] != "PRIQ") {
+ if (!is_numeric($_POST["conn{$i}upload"])) {
+ $savemsg = gettext("Upload bandwidth of connection {$i} is not valid.");
$stepid--;
return;
}
- } else {
- $factor = wizard_get_bandwidthtype_scale($config['ezshaper']['step2']["conn{$i}uploadspeed"]);
- $ifbw = $factor * floatval($config['ezshaper']['step2']["conn{$i}upload"]);
- $factor = wizard_get_bandwidthtype_scale($_POST["conn{$i}uploadspeed"]);
- $input_bw = $factor * floatval($_POST["conn{$i}upload"]);
- if ((0.8 * $ifbw) < $input_bw) {
- $savemsg=gettext("You cannot set the VoIP upload bandwidth on connection {$i} higher than 80% of the connection.");
- $stepid--;
- return;
+ if ($_POST["conn{$i}uploadspeed"] == "%") {
+ if (intval($_POST["conn{$i}upload"]) > 80) {
+ $savemsg=gettext("You cannot set the VoIP upload bandwidth on connection {$i} higher than 80% of the connection.");
+ $stepid--;
+ return;
+ }
+ } else {
+ $factor = wizard_get_bandwidthtype_scale($config['ezshaper']['step2']["conn{$i}uploadspeed"]);
+ $ifbw = $factor * floatval($config['ezshaper']['step2']["conn{$i}upload"]);
+ $factor = wizard_get_bandwidthtype_scale($_POST["conn{$i}uploadspeed"]);
+ $input_bw = $factor * floatval($_POST["conn{$i}upload"]);
+ if ((0.8 * $ifbw) < $input_bw) {
+ $savemsg=gettext("You cannot set the VoIP upload bandwidth on connection {$i} higher than 80% of the connection.");
+ $stepid--;
+ return;
+ }
}
}
- if (!is_numeric($_POST["local{$i}download"])) {
- $savemsg = gettext("Download bandwidth of connection {$i} is not valid.");
- $stepid--;
- return;
- }
- if ($_POST["local{$i}downloadspeed"] == "%") {
- if (intval($_POST["local{$i}download"]) > 80) {
- $savemsg=gettext("You cannot set the VoIP upload bandwidth on connection {$i} higher than 80% of the connection.");
+ if ($config['ezshaper']['step2']["local{$i}downloadscheduler"] != "PRIQ") {
+ if (!is_numeric($_POST["local{$i}download"])) {
+ $savemsg = gettext("Download bandwidth of connection {$i} is not valid.");
$stepid--;
return;
}
- } else {
- $factor = wizard_get_bandwidthtype_scale($config['ezshaper']['step2']["conn{$i}downloadspeed"]);
- $ifbw = $factor * floatval($config['ezshaper']['step2']["conn{$i}download"]);
- $factor = wizard_get_bandwidthtype_scale($_POST["local{$i}downloadspeed"]);
- $input_bw = $factor * floatval($_POST["local{$i}download"]);
- if ((0.8 * $ifbw) < $input_bw) {
- $savemsg=gettext("You cannot set the VoIP download bandwidth on connection {$i} higher than 80% of the connection.");
- $stepid--;
- return;
+ if ($_POST["local{$i}downloadspeed"] == "%") {
+ if (intval($_POST["local{$i}download"]) > 80) {
+ $savemsg=gettext("You cannot set the VoIP upload bandwidth on connection {$i} higher than 80% of the connection.");
+ $stepid--;
+ return;
+ }
+ } else {
+ $factor = wizard_get_bandwidthtype_scale($config['ezshaper']['step2']["conn{$i}downloadspeed"]);
+ $ifbw = $factor * floatval($config['ezshaper']['step2']["conn{$i}download"]);
+ $factor = wizard_get_bandwidthtype_scale($_POST["local{$i}downloadspeed"]);
+ $input_bw = $factor * floatval($_POST["local{$i}download"]);
+ if ((0.8 * $ifbw) < $input_bw) {
+ $savemsg=gettext("You cannot set the VoIP download bandwidth on connection {$i} higher than 80% of the connection.");
+ $stepid--;
+ return;
+ }
}
}
}
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 7b2ff68..c3e0e28 100644
--- a/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc
+++ b/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc
@@ -306,27 +306,29 @@ function step2_stepsubmitphpaction() {
$stepid--;
return;
}
- if (!is_numeric($_POST["conn{$i}upload"])) {
- $savemsg = gettext("Upload bandwidth of connection {$i} is not valid.");
- $stepid--;
- return;
- }
- if (!is_numeric($_POST["conn{$i}download"])) {
- $savemsg = gettext("Download bandwidth of connection {$i} is not valid.");
- $stepid--;
- return;
- }
- $upbw = $_POST["conn{$i}upload"];
- $downbw = $_POST["conn{$i}download"];
- if ($upbw < 1 || $downbw < 1) {
- $savemsg = gettext("You cannot specify 0 bandwidth!");
- $stepid--;
- return;
- }
- if (intval($upbw) < 128 && $_POST["conn{$i}uploadspeed"] == "Kb" && trim($_POST["conn{$i}uploadscheduler"]) == "CBQ") {
- $savemsg=gettext("Uploads smaller than 128Kbit/s is not supported for connection {$i} on CBQ scheduler.");
- $stepid--;
- return;
+ if (trim($_POST["conn{$i}uploadscheduler"]) != "PRIQ") {
+ if (!is_numeric($_POST["conn{$i}upload"])) {
+ $savemsg = gettext("Upload bandwidth of connection {$i} is not valid.");
+ $stepid--;
+ return;
+ }
+ if (!is_numeric($_POST["conn{$i}download"])) {
+ $savemsg = gettext("Download bandwidth of connection {$i} is not valid.");
+ $stepid--;
+ return;
+ }
+ $upbw = $_POST["conn{$i}upload"];
+ $downbw = $_POST["conn{$i}download"];
+ if ($upbw < 1 || $downbw < 1) {
+ $savemsg = gettext("You cannot specify 0 bandwidth!");
+ $stepid--;
+ return;
+ }
+ if (intval($upbw) < 128 && $_POST["conn{$i}uploadspeed"] == "Kb" && trim($_POST["conn{$i}uploadscheduler"]) == "CBQ") {
+ $savemsg=gettext("Uploads smaller than 128Kbit/s is not supported for connection {$i} on CBQ scheduler.");
+ $stepid--;
+ return;
+ }
}
}
for ($j = 0; $j < $localint; $j++) {
@@ -541,6 +543,8 @@ function step3_stepsubmitphpaction() {
$steps = intval($config['ezshaper']['step1']['numberofconnections']);
for ($i = 0; $i < $steps; $i++) {
+ if ($config['ezshaper']['step2']["conn{$i}uploadscheduler"] == "PRIQ")
+ continue;
if (!is_numeric($_POST["conn{$i}upload"])) {
$savemsg = gettext("Upload bandwidth of connection {$i} is not valid.");
$stepid--;
@@ -567,6 +571,8 @@ function step3_stepsubmitphpaction() {
$localint = intval($config['ezshaper']['step1']['numberoflocalinterfaces']);
for ($i = 0; $i < $localint; $i++) {
+ if ($config['ezshaper']['step2']["local{$i}downloadscheduler"] == "PRIQ")
+ continue;
if (!is_numeric($_POST["local{$i}download"])) {
$savemsg = gettext("Download bandwidth of connection {$i} is not valid.");
$stepid--;
OpenPOWER on IntegriCloud