diff options
author | smos <seth.mos@dds.nl> | 2011-11-27 18:56:24 +0100 |
---|---|---|
committer | smos <seth.mos@dds.nl> | 2011-11-27 18:56:24 +0100 |
commit | f328ad12e0cb2d2af4fbbdfc8b4cfbe53ab00f0c (patch) | |
tree | 0e7203c64d11dff83e200f071224db0fe2dd00eb | |
parent | af6f42c11cff923970dd1f5429d74f929b3c10ff (diff) | |
download | pfsense-f328ad12e0cb2d2af4fbbdfc8b4cfbe53ab00f0c.zip pfsense-f328ad12e0cb2d2af4fbbdfc8b4cfbe53ab00f0c.tar.gz |
Fix for redmine ticket #1993. Allow saving multiple dynamic entries.
Make sure that return_gateways_status() also returns all gateways that have monitoring disabled as up.
-rw-r--r-- | etc/inc/gwlb.inc | 26 | ||||
-rwxr-xr-x | usr/local/www/system_gateways_edit.php | 12 |
2 files changed, 26 insertions, 12 deletions
diff --git a/etc/inc/gwlb.inc b/etc/inc/gwlb.inc index 79bf71d..715921d 100644 --- a/etc/inc/gwlb.inc +++ b/etc/inc/gwlb.inc @@ -267,6 +267,32 @@ function return_gateways_status($byname = false) { $status[$target]['status'] = trim($info[8]); } + /* tack on any gateways that have monitoring disabled */ + $gateways_arr = return_gateways_array(); + foreach($gateways_arr as $gwitem) { + if(isset($gwitem['monitor_disable'])) { + if(!is_ipaddr($gwitem['monitorip'])) { + $realif = $gwitem['interface']; + $tgtip = get_interface_gateway($realif); + $srcip = find_interface_ip($realif); + } else { + $tgtip = $gwitem['monitorip']; + $srcip = find_interface_ip($realif); + } + if($byname == true) + $target = $gwitem['name']; + else + $target = $tgtip; + + $status[$target]['monitorip'] = $tgtip; + $status[$target]['srcip'] = $srcip; + $status[$target]['name'] = $gwitem['name']; + $status[$target]['lastcheck'] = date('r'); + $status[$target]['delay'] = "0.0ms"; + $status[$target]['loss'] = "0.0%"; + $status[$target]['status'] = "none"; + } + } return($status); } diff --git a/usr/local/www/system_gateways_edit.php b/usr/local/www/system_gateways_edit.php index d2db8c5..0128ef2 100755 --- a/usr/local/www/system_gateways_edit.php +++ b/usr/local/www/system_gateways_edit.php @@ -197,18 +197,6 @@ if ($_POST) { } if (!$input_errors) { - if (!($_POST['weight'] > 1 || $_POST['latencylow'] || $_POST['latencyhigh'] || - $_POST['losslow'] || $_POST['losshigh'] || $_POST['down'] || - $_POST['defaultgw'] || is_ipaddr($_POST['monitor']) || is_ipaddr($_POST['gateway']))) { - /* Delete from config if gw is dynamic and user is not saving any additional gateway data that system doesn't know */ - if (isset($id) && $a_gateway_item[$id]) - unset($a_gateway_item[$id]); - write_config(); - header("Location: system_gateways.php"); - exit; - } - - $reloadif = ""; $gateway = array(); |