summaryrefslogtreecommitdiffstats
path: root/etc/inc/vslb.inc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2005-08-25 22:31:58 +0000
committerScott Ullrich <sullrich@pfsense.org>2005-08-25 22:31:58 +0000
commitfbcda26c8f44dc8505c664ff9f32cf612853fd66 (patch)
tree5abb27d8f9148e4251a7fe3f8f78854da8efcf56 /etc/inc/vslb.inc
parentab68e3a8abc94ed4e95d80ea4685b28a1fcd5a37 (diff)
downloadpfsense-fbcda26c8f44dc8505c664ff9f32cf612853fd66.zip
pfsense-fbcda26c8f44dc8505c664ff9f32cf612853fd66.tar.gz
Only iterate through item if its an array
Diffstat (limited to 'etc/inc/vslb.inc')
-rw-r--r--etc/inc/vslb.inc64
1 files changed, 33 insertions, 31 deletions
diff --git a/etc/inc/vslb.inc b/etc/inc/vslb.inc
index e341560..4508677 100644
--- a/etc/inc/vslb.inc
+++ b/etc/inc/vslb.inc
@@ -43,40 +43,42 @@ function slbd_configure() {
$fd = fopen("{$g['varetc_path']}/slbd.conf", "w");
- foreach ($a_vs as $vsent) {
- if ($vsent['desc'] == "")
- $slbdconf .= "{$vsent['name']}:\\\n";
- else
- $slbdconf .= "{$vsent['name']}|{$vsent['desc']}:\\\n";
-
- /* pool name */
- $slbdconf .= "\t:poolname={$vsent['name']}:\\\n";
- /* virtual IP */
- $slbdconf .= "\t:vip={$vsent['ipaddr']}:\\\n";
- /* virtual port */
- $slbdconf .= "\t:vip-port={$vsent['port']}:\\\n";
- /* fallback IP */
- $slbdconf .= "\t:sitedown={$vsent['ipaddr']}:\\\n";
- /* fallback port */
- $slbdconf .= "\t:sitedown-port={$vsent['port']}:\\\n";
-
- for ($i = 0; isset($config['load_balancer']['lbpool'][$i]); $i++) {
- if ($config['load_balancer']['lbpool'][$i]['name'] == $vsent['pool']) {
- $svrcnt = 0;
- $svrtxt = "";
- $svrtxt = "\t:service-port={$config['load_balancer']['lbpool'][$i]['port']}:\\\n";
- foreach ($config['load_balancer']['lbpool'][$i]['servers'] as $lbsvr) {
- $svrtxt .= "\t:{$svrcnt}={$lbsvr}:\\\n";
- $svrcnt++;
+ if(is_array($a_vs)) {
+ foreach ($a_vs as $vsent) {
+ if ($vsent['desc'] == "")
+ $slbdconf .= "{$vsent['name']}:\\\n";
+ else
+ $slbdconf .= "{$vsent['name']}|{$vsent['desc']}:\\\n";
+
+ /* pool name */
+ $slbdconf .= "\t:poolname={$vsent['name']}:\\\n";
+ /* virtual IP */
+ $slbdconf .= "\t:vip={$vsent['ipaddr']}:\\\n";
+ /* virtual port */
+ $slbdconf .= "\t:vip-port={$vsent['port']}:\\\n";
+ /* fallback IP */
+ $slbdconf .= "\t:sitedown={$vsent['ipaddr']}:\\\n";
+ /* fallback port */
+ $slbdconf .= "\t:sitedown-port={$vsent['port']}:\\\n";
+
+ for ($i = 0; isset($config['load_balancer']['lbpool'][$i]); $i++) {
+ if ($config['load_balancer']['lbpool'][$i]['name'] == $vsent['pool']) {
+ $svrcnt = 0;
+ $svrtxt = "";
+ $svrtxt = "\t:service-port={$config['load_balancer']['lbpool'][$i]['port']}:\\\n";
+ foreach ($config['load_balancer']['lbpool'][$i]['servers'] as $lbsvr) {
+ $svrtxt .= "\t:{$svrcnt}={$lbsvr}:\\\n";
+ $svrcnt++;
+ }
+ $slbdconf .= "\t:services={$svrcnt}:\\\n";
+ $slbdconf .= $svrtxt;
}
- $slbdconf .= "\t:services={$svrcnt}:\\\n";
- $slbdconf .= $svrtxt;
}
+
+ $slbdconf .= "\t:tcppoll:send=:expect=:\n";
+
+ $should_start=1;
}
-
- $slbdconf .= "\t:tcppoll:send=:expect=:\n";
-
- $should_start=1;
}
if($should_start == 1) {
OpenPOWER on IntegriCloud