summaryrefslogtreecommitdiffstats
path: root/etc/inc
diff options
context:
space:
mode:
authorErmal Luçi <eri@pfsense.org>2008-07-17 16:37:17 +0000
committerErmal Luçi <eri@pfsense.org>2008-07-17 16:37:17 +0000
commitec656e20a5b0f92189c4e2a5d23e5154dd63926d (patch)
treef66392d7a879fbcecd2a88c32a9fbcbc120c4b86 /etc/inc
parentcc72f352379f390327bf40d276a5a7959a86c3ca (diff)
downloadpfsense-ec656e20a5b0f92189c4e2a5d23e5154dd63926d.zip
pfsense-ec656e20a5b0f92189c4e2a5d23e5154dd63926d.tar.gz
Fix php oddities. How can empty/count return true for an empty/0 elements arrayscp shaper.inc root@192.168.10.65:/etc/incscp shaper.inc root@192.168.10.65:/etc/inc.
Diffstat (limited to 'etc/inc')
-rw-r--r--etc/inc/shaper.inc11
1 files changed, 8 insertions, 3 deletions
diff --git a/etc/inc/shaper.inc b/etc/inc/shaper.inc
index 04a5726..d1542d7 100644
--- a/etc/inc/shaper.inc
+++ b/etc/inc/shaper.inc
@@ -3173,10 +3173,13 @@ function read_dummynet_config() {
$dummynet_pipe_list = array();
- if (!is_array($config['dnshaper']['queue']))
+ if (!is_array($config['dnshaper']['queue'])
+ || !count($config['dnshaper']['queue']))
return;
foreach ($a_int as $key => $conf) {
+ if (empty($conf['name']))
+ continue; /* XXX: grrrrrr at php */
$root =& new dnpipe_class();
$root->ReadConfig($conf);
$root->SetNumber($dnpipenumber);
@@ -3240,14 +3243,16 @@ function filter_generate_dummynet_rules() {
read_dummynet_config();
- if (count($dummynet_pipe_list) > 0) {
+ if (!empty($dummynet_pipe_list)) {
mwexec("kldload dummynet");
mwexec("pfctl -F dummynet");
}
$dn_rules = "";
- foreach ($dummynet_pipe_list as $dn)
+ foreach ($dummynet_pipe_list as $test => $dn) {
+ $dn_rules .= "#{$test} !!\n";
$dn_rules .= $dn->build_rules();
+ }
return $dn_rules;
}
OpenPOWER on IntegriCloud