summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2005-08-07 02:41:42 +0000
committerScott Ullrich <sullrich@pfsense.org>2005-08-07 02:41:42 +0000
commitf3037b7e1b1f60fe011a60de8685f0f4cf50aefc (patch)
treea591c9028509fe035ca67e09ac850d53b038a264 /etc
parent6b5115eeaa76fb6b238bf39a85646781acdfa923 (diff)
downloadpfsense-f3037b7e1b1f60fe011a60de8685f0f4cf50aefc.zip
pfsense-f3037b7e1b1f60fe011a60de8685f0f4cf50aefc.tar.gz
If /tmp/{$load_balancing_name}.pool exists then read this in as our gateways. SLBD will populate this for outgoing load balancing soon.
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/filter.inc12
1 files changed, 7 insertions, 5 deletions
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc
index 9d12de0..8cfb2ce 100644
--- a/etc/inc/filter.inc
+++ b/etc/inc/filter.inc
@@ -1346,11 +1346,13 @@ function generate_user_filter_rule($rule, $ngcounter) {
foreach($config['load_balancer']['lbpool'] as $lb) {
if($lb['name'] == $rule['gateway']) {
$gateway = "";
- /* XXX: when slbd writes out helper file,
- * simply read in and feed to route-to
- */
$line .= " route-to { ";
- foreach($lb['servers'] as $server) {
+ if(file_exists("{$g['tmp_path']}/{$lb['name']}.pool")) {
+ $lbs = split("\n", file_get_contents("{$g['tmp_path']}/{$lb['name']}.pool"));
+ } else {
+ $lbs = $lb['servers'];
+ }
+ foreach($lbs as $server) {
$gateway .= $server . " ";
if($foundlb == 1)
$line .= ", ";
@@ -1359,9 +1361,9 @@ function generate_user_filter_rule($rule, $ngcounter) {
$foundlb = 1;
}
$line .= "} ";
-
}
}
+ /* we're not using load balancing, just setup gateway */
if($foundlb == 0) {
$int = guess_interface_from_ip($rule['gateway']);
$line .= " route-to (" . $int . " " . $rule['gateway'] . ") ";
OpenPOWER on IntegriCloud