summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorSeth Mos <seth.mos@xs4all.nl>2007-02-19 19:13:00 +0000
committerSeth Mos <seth.mos@xs4all.nl>2007-02-19 19:13:00 +0000
commit971e80802e8d1e1dffd4471c8887c402a2958497 (patch)
tree138a9730c9ff92664ee64f805636b111156a82b4 /etc
parent5b4c9c6bf987a0b690c35aa6d16f32e6fdce274b (diff)
downloadpfsense-971e80802e8d1e1dffd4471c8887c402a2958497.zip
pfsense-971e80802e8d1e1dffd4471c8887c402a2958497.tar.gz
If the /tmp/slbd.pool file does not exist use the config settings.
If the slbd.pool file does not contain entries use the config settings. Case 1 happens when startup is so fast that the pool file is not yet created and we created incorrect server list which happend to have the poolnames in it. Instead of gateways. Case 2 is a precaution.
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/filter.inc15
1 files changed, 13 insertions, 2 deletions
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc
index 1cd8774..71d48bb 100644
--- a/etc/inc/filter.inc
+++ b/etc/inc/filter.inc
@@ -1406,10 +1406,21 @@ function generate_user_filter_rule($rule, $ngcounter) {
/* if /tmp/$lbname.pool exists then read in our gateway hints from slbd */
if(file_exists("{$g['tmp_path']}/{$lb['name']}.pool")) {
$lbs = split("\n", file_get_contents("{$g['tmp_path']}/{$lb['name']}.pool"));
+ if(empty($lbs)) {
+ log_error("There are no servers found in the status file, using XML config settings!");
+ foreach ($lb['servers'] as $lbsvr) {
+ $lbsvr_split = split("\|", $lbsvr);
+ $lbs[] = $lbsvr_split[1];
+ }
+ }
} else {
- $lbs = $lb['servers'];
+ log_error("There is no server status file, using XML config settings!");
+ $lbs = array();
+ foreach ($lb['servers'] as $lbsvr) {
+ $lbsvr_split = split("\|", $lbsvr);
+ $lbs[] = $lbsvr_split[1];
+ }
}
-
/* If we want failover we only return the first (top) server from the list
* and work our way down from there. This way we order the failover order.
*/
OpenPOWER on IntegriCloud