summaryrefslogtreecommitdiffstats
path: root/etc/inc
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2010-05-18 17:10:50 +0000
committerErmal <eri@pfsense.org>2010-05-18 17:36:44 +0000
commitd9dda2a5718709341852fed8b3328cfa2fd48198 (patch)
treed252794c90738b73fd8c62ce76841bb93e6a7f88 /etc/inc
parent4e6593de5a18b785565a4bcd454f2d3e31d2518c (diff)
downloadpfsense-d9dda2a5718709341852fed8b3328cfa2fd48198.zip
pfsense-d9dda2a5718709341852fed8b3328cfa2fd48198.tar.gz
Fixes #536. Actually add all available gateways to the gateway_groups array so all up members will be present for balancing.
Diffstat (limited to 'etc/inc')
-rw-r--r--etc/inc/gwlb.inc12
1 files changed, 7 insertions, 5 deletions
diff --git a/etc/inc/gwlb.inc b/etc/inc/gwlb.inc
index aa8397d..a02f77f 100644
--- a/etc/inc/gwlb.inc
+++ b/etc/inc/gwlb.inc
@@ -249,7 +249,7 @@ function return_gateways_status() {
$gateways_arr = return_gateways_array();
$apingerstatus = array();
- if(is_readable("{$g['tmp_path']}/apinger.status")) {
+ if (file_exists("{$g['tmp_path']}/apinger.status")) {
$apingerstatus = file("{$g['tmp_path']}/apinger.status");
}
@@ -383,7 +383,7 @@ function return_gateway_groups_array() {
$gwname = $itemsplit[0];
/* check if the gateway is available before adding it to the array */
foreach($gateways_status as $status) {
- if(($status['name'] != $gwname)) {
+ if ($status['name'] != $gwname) {
continue;
}
if (stristr($status['status'], "down")) {
@@ -446,9 +446,11 @@ function return_gateway_groups_array() {
$gatewayip = get_interface_gateway($gateway['friendlyiface']);
}
if (($int <> "") && is_ipaddr($gatewayip)) {
- $gateway_groups_array[$group['name']][$tiernr]['int'] = "$int";
- $gateway_groups_array[$group['name']][$tiernr]['gwip'] = "$gatewayip";
- $gateway_groups_array[$group['name']][$tiernr]['weight'] = isset($gateway['weight']) ? $gateway['weight'] : 1;
+ $groupmember = array();
+ $groupmember['int'] = "$int";
+ $groupmember['gwip'] = "$gatewayip";
+ $groupmember['weight'] = isset($gateway['weight']) ? $gateway['weight'] : 1;
+ $gateway_groups_array[$group['name']][] = $group;
}
}
/* we should have the 1st available tier now, exit stage left */
OpenPOWER on IntegriCloud