mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Return the gateway status only for gateways apinger knows about instead of assuming that all gateways are down, which might give consecuences. Also prepend 'filter_' to the function used to kill states for down gateways in filter.inc to be consistent.
This commit is contained in:
parent
b72eb6c8cc
commit
ae9618afa8
@ -140,8 +140,9 @@ function filter_configure() {
|
||||
touch($g['tmp_path'] . "/filter_dirty");
|
||||
}
|
||||
|
||||
function delete_states_for_down_gateways() {
|
||||
function filter_delete_states_for_down_gateways() {
|
||||
global $config;
|
||||
|
||||
$a_gateways = return_gateways_status();
|
||||
foreach ($a_gateways as $gateway) {
|
||||
if ($gateway['status'] == "down") {
|
||||
@ -369,7 +370,7 @@ function filter_configure_sync() {
|
||||
echo ".";
|
||||
|
||||
update_filter_reload_status("Processing down interface states");
|
||||
delete_states_for_down_gateways();
|
||||
filter_delete_states_for_down_gateways();
|
||||
|
||||
update_filter_reload_status("Running plugins");
|
||||
|
||||
|
||||
@ -243,9 +243,7 @@ EOD;
|
||||
|
||||
/* return the status of the apinger targets as a array */
|
||||
function return_gateways_status() {
|
||||
global $config;
|
||||
global $g;
|
||||
$gateways_arr = return_gateways_array();
|
||||
global $config, $g;
|
||||
|
||||
$apingerstatus = array();
|
||||
if (file_exists("{$g['tmp_path']}/apinger.status")) {
|
||||
@ -253,21 +251,6 @@ function return_gateways_status() {
|
||||
}
|
||||
|
||||
$status = array();
|
||||
$i = 2;
|
||||
/* assign a dummy IP address for dynamic interfaces in case we need it */
|
||||
$monitor = array();
|
||||
foreach($gateways_arr as $name => $gateway) {
|
||||
if($gateway['monitor'] == "dynamic") {
|
||||
$gateway['monitor'] = "127.0.0.{$i}";
|
||||
$i++;
|
||||
}
|
||||
$status[$gateway['monitor']]['monitor'] = $gateway['monitor'];
|
||||
$status[$gateway['monitor']]['interface'] = $gateway['interface'];
|
||||
$status[$gateway['monitor']]['gateway'] = $gateway['gateway'];
|
||||
$status[$gateway['monitor']]['name'] = $gateway['name'];
|
||||
$status[$gateway['monitor']]['status'] = "down";
|
||||
|
||||
}
|
||||
foreach($apingerstatus as $line) {
|
||||
$info = explode("|", $line);
|
||||
$target = $info[0];
|
||||
|
||||
Loading…
Reference in New Issue
Block a user