summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErmal Luçi <eri@pfsense.org>2013-04-16 00:06:18 -0700
committerErmal Luçi <eri@pfsense.org>2013-04-16 00:06:18 -0700
commitb794b21412adf696a6a69f0ce0560204d4b7f713 (patch)
treeea7fa731a0d72be9089fdd6d2098ad220f708621
parentf803db6a51e71bc1b6f49edc68796a121c34d5d6 (diff)
parent4fdd86a37e8ef82298bed1ec684280644f07b61f (diff)
downloadpfsense-b794b21412adf696a6a69f0ce0560204d4b7f713.zip
pfsense-b794b21412adf696a6a69f0ce0560204d4b7f713.tar.gz
Merge pull request #575 from avandeweghe/patch-1
Add default case when detecting dynamic gateway ip
-rw-r--r--etc/inc/gwlb.inc16
1 files changed, 16 insertions, 0 deletions
diff --git a/etc/inc/gwlb.inc b/etc/inc/gwlb.inc
index 4e9ca84..f842857 100644
--- a/etc/inc/gwlb.inc
+++ b/etc/inc/gwlb.inc
@@ -383,6 +383,14 @@ function return_gateways_array($disabled = false, $localhost = false) {
$gateway['gateway'] = "dynamic";
$gateway['dynamic'] = true;
break;
+ default:
+ $gateway['ipprotocol'] = "inet";
+ $gateway['gateway'] = get_interface_gateway($gateway['interface']);
+ /* no IP address found, set to dynamic */
+ if (!is_ipaddrv4($gateway['gateway']))
+ $gateway['gateway'] = "dynamic";
+ $gateway['dynamic'] = true;
+ break;
}
}
@@ -403,6 +411,14 @@ function return_gateways_array($disabled = false, $localhost = false) {
$gateway['gateway'] = "dynamic6";
$gateway['dynamic'] = true;
break;
+ default:
+ $gateway['ipprotocol'] = "inet6";
+ $gateway['gateway'] = get_interface_gateway_v6($gateway['interface']);
+ /* no IPv6 address found, set to dynamic6 */
+ if (!is_ipaddrv6($gateway['gateway']))
+ $gateway['gateway'] = "dynamic6";
+ $gateway['dynamic'] = true;
+ break;
}
}
} else {
OpenPOWER on IntegriCloud