summaryrefslogtreecommitdiffstats
path: root/etc/inc/gwlb.inc
diff options
context:
space:
mode:
authorPhil Davis <phil.davis@inf.org>2014-02-27 18:54:51 -0800
committerPhil Davis <phil.davis@inf.org>2014-02-27 18:54:51 -0800
commitf60003faf1343a532f52a3f03a5e9c6687b470e3 (patch)
treeaa2db905650c649249dccb755c692b0d248994f7 /etc/inc/gwlb.inc
parent2124fad4d0bafd6e0d47eff7251136cd6d1ec9cc (diff)
downloadpfsense-f60003faf1343a532f52a3f03a5e9c6687b470e3.zip
pfsense-f60003faf1343a532f52a3f03a5e9c6687b470e3.tar.gz
Return GWG IP protocol (version) when no gateway IP
This is a resubmit of an older pull request I had closed. It came up again in the forum, with a user setting up a VM environment and wondering why he cannot make policy-routing rules to a gateway group. The gateway group names did not display because all his WANs were down at the time and so the existing code was too dumb to determine the IP protocol (version 4 or 6) when none of the WANs in the gateway group actually have an IP address yet.
Diffstat (limited to 'etc/inc/gwlb.inc')
-rw-r--r--etc/inc/gwlb.inc18
1 files changed, 10 insertions, 8 deletions
diff --git a/etc/inc/gwlb.inc b/etc/inc/gwlb.inc
index 27271d7..faf2a00 100644
--- a/etc/inc/gwlb.inc
+++ b/etc/inc/gwlb.inc
@@ -827,15 +827,17 @@ function return_gateway_groups_array() {
else if (!empty($int))
$gatewayip = get_interface_gateway($gateway['friendlyiface']);
- if (!empty($int) && is_ipaddr($gatewayip)) {
- $groupmember = array();
- $groupmember['int'] = $int;
- $groupmember['gwip'] = $gatewayip;
- $groupmember['weight'] = isset($gateway['weight']) ? $gateway['weight'] : 1;
- if (is_array($gwvip_arr[$group['name']])&& !empty($gwvip_arr[$group['name']][$member]))
- $groupmember['vip'] = $gwvip_arr[$group['name']][$member];
+ if (!empty($int)) {
$gateway_groups_array[$group['name']]['ipprotocol'] = $gateway['ipprotocol'];
- $gateway_groups_array[$group['name']][] = $groupmember;
+ if (is_ipaddr($gatewayip)) {
+ $groupmember = array();
+ $groupmember['int'] = $int;
+ $groupmember['gwip'] = $gatewayip;
+ $groupmember['weight'] = isset($gateway['weight']) ? $gateway['weight'] : 1;
+ if (is_array($gwvip_arr[$group['name']])&& !empty($gwvip_arr[$group['name']][$member]))
+ $groupmember['vip'] = $gwvip_arr[$group['name']][$member];
+ $gateway_groups_array[$group['name']][] = $groupmember;
+ }
}
}
}
OpenPOWER on IntegriCloud