summaryrefslogtreecommitdiffstats
path: root/etc/inc
diff options
context:
space:
mode:
authorsmos <seth.mos@dds.nl>2012-06-01 07:41:15 +0200
committersmos <seth.mos@dds.nl>2012-06-01 07:46:55 +0200
commite02caf4ab97b993a62e81c5002bd0581165e4a64 (patch)
tree0c445c049eff3e2600fc136ba881c3ebabf712f6 /etc/inc
parent4473e33cf345da613da44f0d7a1df2beb1686731 (diff)
downloadpfsense-e02caf4ab97b993a62e81c5002bd0581165e4a64.zip
pfsense-e02caf4ab97b993a62e81c5002bd0581165e4a64.tar.gz
Actually save the IPprotocol variable into the config, otherwise it stil won't work.
People will likely need to edit and save their gateways now if they have double entries. e.g. both manual and automatically added entries, these will dissapear as soon as you save. If we know if the gateway or monitor is ipv4 or ipv6 we can autodetect which prevents this. Because we don't know what address family the gateway on a dual stack interface belongs to we better not guess, and let the user figure it out. Often, a edit and save is the fastest. For upgrading from 2.0 we could mark all gateways as being ipv4 which prevents half of the issues. Redmine ticket #2463
Diffstat (limited to 'etc/inc')
-rw-r--r--etc/inc/gwlb.inc8
1 files changed, 6 insertions, 2 deletions
diff --git a/etc/inc/gwlb.inc b/etc/inc/gwlb.inc
index a3cbe41..68b3e48 100644
--- a/etc/inc/gwlb.inc
+++ b/etc/inc/gwlb.inc
@@ -340,7 +340,6 @@ function return_gateways_array($disabled = false) {
continue;
$wancfg = $config['interfaces'][$gateway['interface']];
-
/* getting this detection right is hard at this point because we still don't
* store the address family in the gateway item */
if(is_ipaddrv4($gateway['gateway']))
@@ -348,13 +347,18 @@ function return_gateways_array($disabled = false) {
if(is_ipaddrv6($gateway['gateway']))
$gateway['ipprotocol'] = "inet6";
if((preg_match("/dynamic/i", $gateway['gateway'])) && (!isset($gateway['ipprotocol']))) {
+ if(is_ipaddrv4($gateway['gateway']))
+ $gateway['ipprotocol'] = "inet";
+ if(is_ipaddrv6($gateway['gateway']))
+ $gateway['ipprotocol'] = "inet6";
+ }
+ if((preg_match("/dynamic/i", $gateway['monitor'])) && (!isset($gateway['ipprotocol']))) {
if(is_ipaddrv4($gateway['monitor']))
$gateway['ipprotocol'] = "inet";
if(is_ipaddrv6($gateway['monitor']))
$gateway['ipprotocol'] = "inet6";
}
-
/* if the gateway is dynamic and we can find the IPv4, Great! */
if(empty($gateway['gateway']) || ($gateway['gateway'] == "dynamic") && ($gateway['ipprotocol'] == "inet")) {
/* we know which interfaces is dynamic, this should be made a function */
OpenPOWER on IntegriCloud