aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2007-02-20 04:05:25 +0000
committerScott Ullrich <sullrich@pfsense.org>2007-02-20 04:05:25 +0000
commit5b9b67f23c52be2cc0254dc45a226a94f22b7301 (patch)
treed1966b58d213154695747a47576ad5311f40a46e
parent959dbc00362ba9a4e35843a8563c52005e4ed151 (diff)
downloadpfsense-packages-5b9b67f23c52be2cc0254dc45a226a94f22b7301.tar.gz
pfsense-packages-5b9b67f23c52be2cc0254dc45a226a94f22b7301.tar.bz2
pfsense-packages-5b9b67f23c52be2cc0254dc45a226a94f22b7301.zip
Do not enumerate variable unless it is a variable.
-rw-r--r--packages/bandwidthd/bandwidthd.inc26
1 files changed, 14 insertions, 12 deletions
diff --git a/packages/bandwidthd/bandwidthd.inc b/packages/bandwidthd/bandwidthd.inc
index 67a251e7..262530ce 100644
--- a/packages/bandwidthd/bandwidthd.inc
+++ b/packages/bandwidthd/bandwidthd.inc
@@ -83,18 +83,20 @@ function bandwidthd_install_config() {
//for ($j = 1; isset($config['interfaces']['opt' . $j]); $j++) {
//$ifdescrs['opt' . $j] = "opt" . $j;
//}
- foreach($ifdescrs as $int) {
- /* calculate interface subnet information */
- $ifcfg = &$config['interfaces'][$int];
- $subnet = gen_subnet($ifcfg['ipaddr'], $ifcfg['subnet']);
- $subnetmask = gen_subnet_mask($ifcfg['subnet']);
- if($subnet == "pppoe") {
- $subnet = find_interface_ip("ng0");
- if($subnet)
- $subnets .= "subnet {$subnet}/32\n";
- } else {
- if($subnet)
- $subnets .= "subnet {$subnet}/{$ifcfg['subnet']}\n";
+ if(is_array($ifdescrs)) {
+ foreach($ifdescrs as $int) {
+ /* calculate interface subnet information */
+ $ifcfg = &$config['interfaces'][$int];
+ $subnet = gen_subnet($ifcfg['ipaddr'], $ifcfg['subnet']);
+ $subnetmask = gen_subnet_mask($ifcfg['subnet']);
+ if($subnet == "pppoe") {
+ $subnet = find_interface_ip("ng0");
+ if($subnet)
+ $subnets .= "subnet {$subnet}/32\n";
+ } else {
+ if($subnet)
+ $subnets .= "subnet {$subnet}/{$ifcfg['subnet']}\n";
+ }
}
}