summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2006-04-14 23:09:48 +0000
committerScott Ullrich <sullrich@pfsense.org>2006-04-14 23:09:48 +0000
commit39367ad7ad91ed86282d806779ab37a062d94ab6 (patch)
tree93ad8aa60cd02f213e740769ffe44b036f7e4f20 /etc
parent1e6f5e9ddabe80aa72518197e19c09fa03953d4c (diff)
downloadpfsense-39367ad7ad91ed86282d806779ab37a062d94ab6.zip
pfsense-39367ad7ad91ed86282d806779ab37a062d94ab6.tar.gz
MFC 11418
This should allow the gateway pools to be updated when the monitor ip is unavailable Tickets:
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/filter.inc40
1 files changed, 20 insertions, 20 deletions
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc
index 04d9e74..ce54065 100644
--- a/etc/inc/filter.inc
+++ b/etc/inc/filter.inc
@@ -1212,27 +1212,27 @@ function generate_user_filter_rule($rule, $ngcounter) {
} else {
$lbs = $lb['servers'];
}
- /* iterate through $lbs and setup items accordingly */
- foreach($lbs as $server) {
- if($foundlb == 1)
- $line .= ", ";
- /* we are seperating the monitor address from the gateway
- * using the | character
- */
- if(stristr($server, "|") == true) {
- $split_ip = split("\|", $server);
- $rule['gateway'] = $split_ip[0];
- $gateway = $split_ip[0];
- }
- /* determine interface from gateway address */
- $int = guess_interface_from_ip($gateway);
- $line .= "( {$int} {$gateway} ) ";
- if($int == "") {
- $line = "# error resolving load balancing {$gateway}";
+
+ /* iterate through $lbs and setup items accordingly */
+ foreach($lbs as $server) {
+ for ($i = 0; isset($config['load_balancer']['lbpool'][$i]); $i++) {
+ foreach ($config['load_balancer']['lbpool'][$i]['servers'] as $lbsvr) {
+ $lbsvr_split=split("\|", $lbsvr);
+ if ($lbsvr_split[1] == $server)
+ $gateway = $lbsvr_split[1];
+ }
}
- $foundlb = 1;
- }
- $line .= "} round-robin ";
+ if($foundlb == 1)
+ $line .= ", ";
+ /* determine interface from gateway address */
+ $int = guess_interface_from_ip($gateway);
+ $line .= "( {$int} {$gateway} ) ";
+ if($int == "") {
+ $line = "# error resolving load balancing {$gateway}";
+ }
+ $foundlb = 1;
+ }
+ $line .= "} round-robin ";
}
}
}
OpenPOWER on IntegriCloud