summaryrefslogtreecommitdiffstats
path: root/etc/inc/gwlb.inc
diff options
context:
space:
mode:
Diffstat (limited to 'etc/inc/gwlb.inc')
-rw-r--r--etc/inc/gwlb.inc7
1 files changed, 5 insertions, 2 deletions
diff --git a/etc/inc/gwlb.inc b/etc/inc/gwlb.inc
index fcffdc2..0c8b3b7 100644
--- a/etc/inc/gwlb.inc
+++ b/etc/inc/gwlb.inc
@@ -275,6 +275,7 @@ function return_gateways_array($disabled = false) {
if(! is_ipaddr($gateway['gateway'])) {
$gateway['gateway'] = "dynamic";
}
+ $gateway['dynamic'] = true;
}
if($gateway['monitor'] == "") {
$gateway['monitor'] = $gateway['gateway'];
@@ -292,7 +293,8 @@ function return_gateways_array($disabled = false) {
continue;
}
$gateway = array();
- $gateway['gateway'] = get_interface_gateway($ifname);
+ $gateway['dynamic'] = false;
+ $gateway['gateway'] = get_interface_gateway($ifname, $gateway['dynamic']);
$gateway['interface'] = get_real_interface($ifname);
$gateway['name'] = "{$ifname}";
$gateway['attribute'] = "system";
@@ -494,7 +496,7 @@ function lookup_gateway_interface_by_name($name) {
return(false);
}
-function get_interface_gateway($interface) {
+function get_interface_gateway($interface, &$dynamic = false) {
global $config, $g;
$iflist = get_configured_interface_with_descr();
@@ -524,6 +526,7 @@ function get_interface_gateway($interface) {
if (file_exists("{$g['tmp_path']}/{$realif}_router")) {
$gw = file_get_contents("{$g['tmp_path']}/{$realif}_router");
$gw = rtrim($gw);
+ $dynamic = true;
}
}
OpenPOWER on IntegriCloud