summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2006-01-23 04:30:53 +0000
committerScott Ullrich <sullrich@pfsense.org>2006-01-23 04:30:53 +0000
commit62a48760b38d2e1252858732298256ff008203c2 (patch)
treeccfdfb64596e6ce23d0a70a29ff0e65c66fbface
parent49fd79aa7ef37645fc5c0f113224202c9b1acdc8 (diff)
downloadpfsense-62a48760b38d2e1252858732298256ff008203c2.zip
pfsense-62a48760b38d2e1252858732298256ff008203c2.tar.gz
MFC 9611
Ticket #792 - fix 6 month old shaper bug that caused erratic speeds and latencies. With a 10Mbit queue and 4 iperf jobs running through it in default and otherL queues, I can get an icmp through in otherH with a mere 25ms additional latency on average.
-rw-r--r--etc/inc/shaper.inc26
-rwxr-xr-xusr/local/www/wizard.php63
2 files changed, 58 insertions, 31 deletions
diff --git a/etc/inc/shaper.inc b/etc/inc/shaper.inc
index f6e6c22..78e80b6 100644
--- a/etc/inc/shaper.inc
+++ b/etc/inc/shaper.inc
@@ -34,7 +34,6 @@ require_once("functions.inc");
require_once("pkg-utils.inc");
require_once("notices.inc");
-
function find_default_queue($interface) {
global $config, $queue_cache;
$qconfig = $config;
@@ -43,7 +42,6 @@ function find_default_queue($interface) {
if (isset($queue_cache['defq'][$interface]))
return $queue_cache['defq'][$interface];
-
if (is_array($qconfig['shaper']['queue'])) {
foreach ($qconfig['shaper']['queue'] as $queue) {
if(isset($queue['defaultqueue']) and ($queue['defaultqueue'] <> "")) {
@@ -65,7 +63,6 @@ function find_default_queue($interface) {
return null;
}
-
function get_ack_queue($interface) {
global $config, $queue_cache;
@@ -90,7 +87,6 @@ function get_ack_queue($interface) {
return null;
}
-
function filter_generate_altq_queues($altq_ints) {
global $config;
$altq_rules = "";
@@ -172,7 +168,6 @@ function is_subqueue_used_on_interface($queuename, $interface) {
return 0;
}
-
function filter_is_queue_being_used_on_interface($queuename, $interface) {
global $config;
$lconfig = $config;
@@ -185,7 +180,6 @@ function filter_is_queue_being_used_on_interface($queuename, $interface) {
return null;
}
-
function filter_setup_altq_interfaces() {
global $config;
$altq_rules = "";
@@ -226,31 +220,22 @@ function filter_setup_altq_interfaces() {
function find_root_queue($ifname) {
global $config;
- $dbg = fopen("/tmp/debug", 'a');
foreach ($config['shaper']['queue'] as $queue) {
$rule_interface = "";
$q = $queue;
- fwrite($dbg, "interface: {$ifname}\n");
- fwrite($dbg, "queue: {$q['name']} parent: {$q['parentqueue']} attached: {$q['attachtoqueue']}\n");
/* if we're a parentqueue and aren't attached to another queue we're probably a root */
if ((isset($q['parentqueue']) && $q['parentqueue'] <> "") && (!isset($q['attachtoqueue']) || $q['attachtoqueue'] == "")) {
- fwrite($dbg, "queue: {$q['name']} is a parent\n");
/* Confirm that this is a valid queue for this interface */
$rule_interface = is_subqueue_used_on_interface($q['name'], $ifname);
if ($rule_interface == 1) {
- fwrite($dbg, "queue: {$q['name']} is a parent on {$ifname}\n");
$queue_names .= " ";
$queue_names .= $q['name'];
}
}
}
- fclose($dbg);
return $queue_names;
}
-
-
-
function is_queue_attached_children($name) {
global $config;
if (!is_array($config['shaper']['queue'])) return 0;
@@ -260,7 +245,6 @@ function is_queue_attached_children($name) {
return 0;
}
-
function queue_interface_recursive($queuename) {
global $config;
foreach($config['shaper']['queue'] as $queue) {
@@ -278,7 +262,6 @@ function queue_interface_recursive($queuename) {
return null;
}
-
function is_subqueue($name) {
global $config;
$queues = $config['shaper']['queue']; /* must assign to keep from corrupting in memory $config */
@@ -289,7 +272,6 @@ function is_subqueue($name) {
return 0;
}
-
function filter_altq_get_queuename($queuenum) {
global $config;
$x=0;
@@ -302,13 +284,11 @@ function filter_altq_get_queuename($queuenum) {
return null;
}
-
function filter_generate_pf_altq_rules() {
/* I don't think we're in IPFW anymore Toto */
-
- global $config, $g, $tcpflags;
-
$i = 0;
+
+ global $config, $g, $tcpflags;
$lancfg = $config['interfaces']['lan'];
$pptpdcfg = $config['pptpd'];
@@ -392,8 +372,6 @@ function filter_generate_pf_altq_rules() {
$ispppoe = false;
}
-
-
if (strstr($rule['source']['network'], "opt")) {
if (!array_key_exists($rule['source']['network'], $optcfg)) {
$i++;
diff --git a/usr/local/www/wizard.php b/usr/local/www/wizard.php
index ebfb02a..ed10d6a 100755
--- a/usr/local/www/wizard.php
+++ b/usr/local/www/wizard.php
@@ -209,11 +209,6 @@ function enablechange() {
else
$ip = "/";
-if($_GET['xml'] == "traffic_shaper_wizard.xml" or
- $_POST['xml'] == "traffic_shaper_wizard.xml") {
- $ip .= "firewall_shaper.php?remove=true";
-}
-
?>
<a href="<?php echo $ip; ?>"><img border="0" src="./themes/<?= $g['theme']; ?>/images/logo.gif"></a>
@@ -275,6 +270,25 @@ if($_GET['xml'] == "traffic_shaper_wizard.xml" or
if($field['validate'])
echo " onChange='FieldValidate(this.value, \"{$field['validate']}\", \"{$field['message']}\");'";
echo ">\n";
+
+
+
+ } else if ($field['type'] == "inputalias") {
+ if(!$field['dontdisplayname']) {
+ echo "<td width=\"22%\" align=\"right\" class=\"vncellreq\">\n";
+ echo fixup_string($field['name']);
+ echo ":</td>\n";
+ }
+ if(!$field['dontcombinecells'])
+ echo "<td class=\"vtable\">\n";
+
+ echo "<input autocomplete='off' class='formfldalias' id='" . $name . "' name='" . $name . "' value='" . $value . "'";
+ if($field['validate'])
+ echo " onChange='FieldValidate(this.value, \"{$field['validate']}\", \"{$field['message']}\");'";
+ echo ">\n";
+
+
+
} else if($field['type'] == "interfaces_selection") {
$size = "";
$multiple = "";
@@ -294,7 +308,7 @@ if($_GET['xml'] == "traffic_shaper_wizard.xml" or
if($field['add_to_interfaces_selection'] == $value) $SELECTED = " SELECTED";
echo "<option value='" . $field['add_to_interfaces_selection'] . "'" . $SELECTED . ">" . $field['add_to_interfaces_selection'] . "</option>\n";
}
- $interfaces = &$config['interfaces'];
+ $interfaces = $config['interfaces'];
if($field['all_interfaces'] <> "") {
$ints = split(" ", `/sbin/ifconfig -l`);
$interfaces = array();
@@ -446,7 +460,42 @@ if($_GET['xml'] == "traffic_shaper_wizard.xml" or
<br>&nbsp;
</div>
</form>
+<script language="JavaScript">
+<!--
+ if (typeof ext_change != 'undefined') {
+ ext_change();
+ }
+ if (typeof proto_change != 'undefined') {
+ ext_change();
+ }
+ if (typeof proto_change != 'undefined') {
+ proto_change();
+ }
+<?php
+ $isfirst = 0;
+ $aliases = "";
+ $addrisfirst = 0;
+ $aliasesaddr = "";
+ if($config['aliases']['alias'] <> "" and is_array($config['aliases']['alias']))
+ foreach($config['aliases']['alias'] as $alias_name) {
+ if(!stristr($alias_name['address'], ".")) {
+ if($isfirst == 1) $aliases .= ",";
+ $aliases .= "'" . $alias_name['name'] . "'";
+ $isfirst = 1;
+ } else {
+ if($addrisfirst == 1) $aliasesaddr .= ",";
+ $aliasesaddr .= "'" . $alias_name['name'] . "'";
+ $addrisfirst = 1;
+ }
+ }
+?>
+
+ var addressarray=new Array(<?php echo $aliasesaddr; ?>);
+ var customarray=new Array(<?php echo $aliases; ?>);
+
+//-->
+</script>
<script type="text/javascript">
NiftyCheck();
Rounded("div#roundme","all","#333333","#FFFFFF","smooth");
@@ -564,4 +613,4 @@ function is_timezone($elt) {
return !preg_match("/\/$/", $elt);
}
-?>
+?> \ No newline at end of file
OpenPOWER on IntegriCloud