diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2004-11-16 02:41:34 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2004-11-16 02:41:34 +0000 |
commit | 3e1e22de1ffd0c4c1deff330acb7dc42bc414a69 (patch) | |
tree | aa4e956142aa87911591e30bc359e255db7aae85 | |
parent | 5dd55fa3ce7a161e5200d944a6cb7d57c53d303e (diff) | |
download | pfsense-3e1e22de1ffd0c4c1deff330acb7dc42bc414a69.zip pfsense-3e1e22de1ffd0c4c1deff330acb7dc42bc414a69.tar.gz |
Our checks where too loose before, if the same type of scheduler was on more than one interface we assigned the queues to all the interfaces with the same definition, etc.
-rw-r--r-- | etc/inc/filter.inc | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc index 58f50b6..ad0b67e 100644 --- a/etc/inc/filter.inc +++ b/etc/inc/filter.inc @@ -115,11 +115,22 @@ function filter_get_altq_queue_scheduler_type($associatedrule) { return $schedulertpye; } +function filter_get_rule_real_interface($associatedrule) { + global $config; + foreach ($config['filter']['rule'] as $rule) { + if($rule['descr'] == $associatedrule) { + $interface = $rule['interface']; + return $config['interfaces'][$interface]['if']; + } + } + return ""; +} + + function filter_get_rule_interface($associatedrule) { global $config; foreach ($config['filter']['rule'] as $rule) { - if($rule['descr'] == $associatedrule) - return $rule['interface']; + if($rule['descr'] == $associatedrule) return $rule['interface']; } return ""; } @@ -166,18 +177,20 @@ function filter_setup_altq_interfaces() { $altq_rules = ""; $queue_names = ""; $is_first = ""; + $queue_names = ""; + $is_first = ""; if (is_array($config['interfaces'])) { foreach ($config['interfaces'] as $ifname) { - $queue_names = ""; - $is_first = ""; if (is_array($config['pfqueueing']['queue'])) { foreach ($config['pfqueueing']['queue'] as $queue) { $schedulertype = $ifname['schedulertype']; if(filter_get_altq_queue_scheduler_type($queue['options']['associatedrule']) == $schedulertype) { - if(is_subqueue($queue['name']) == 0) { - if($is_first) $queue_names .= ", "; - $queue_names .= $queue['name']; - $is_first = "1"; + if (filter_get_rule_real_interface($queue['options']['associatedrule']) == $ifname['if']) { + if(is_subqueue($queue['name']) == 0) { + if($is_first) $queue_names .= ", "; + $queue_names .= $queue['name']; + $is_first = "1"; + } } } } @@ -190,6 +203,8 @@ function filter_setup_altq_interfaces() { $altq_rules .= "queue { " . $queue_names . " }"; } $altq_rules .= "\n"; + $is_first = ""; + $queue_names = ""; } } } |