diff options
-rw-r--r-- | etc/inc/gwlb.inc | 8 | ||||
-rwxr-xr-x | usr/local/www/system_gateways_edit.php | 1 |
2 files changed, 7 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 */ diff --git a/usr/local/www/system_gateways_edit.php b/usr/local/www/system_gateways_edit.php index 6a8936e..84a0b32 100755 --- a/usr/local/www/system_gateways_edit.php +++ b/usr/local/www/system_gateways_edit.php @@ -243,6 +243,7 @@ if ($_POST) { $gateway['gateway'] = "dynamic"; $gateway['name'] = $_POST['name']; $gateway['weight'] = $_POST['weight']; + $gateway['ipprotocol'] = $_POST['ipprotocol']; $gateway['interval'] = $_POST['interval']; $gateway['descr'] = $_POST['descr']; if ($_POST['monitor_disable'] == "yes") |