mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-15 17:14:46 +00:00
system: do not use down / forced down for gateway switching
PR: https://forum.opnsense.org/index.php?topic=9115.0
This commit is contained in:
parent
b8ff445601
commit
195cec19c4
@ -315,11 +315,7 @@ function filter_configure_sync($verbose = false, $flush_states = false)
|
||||
flush();
|
||||
}
|
||||
|
||||
if (isset($config['system']['gw_switch_default'])) {
|
||||
$gateways_status = return_gateways_status(true);
|
||||
$gateways_arr = return_gateways_array();
|
||||
fixup_default_gateway($gateways_status, $gateways_arr);
|
||||
}
|
||||
fixup_default_gateway();
|
||||
|
||||
$aliases = filter_generate_aliases();
|
||||
$aliases .= "\n# Plugins tables\n";
|
||||
|
||||
@ -864,8 +864,17 @@ function return_gateways_array($disabled = false, $localhost = false, $inactive
|
||||
return $gateways_arr;
|
||||
}
|
||||
|
||||
function fixup_default_gateway($gateways_status, $gateways_arr)
|
||||
function fixup_default_gateway()
|
||||
{
|
||||
global $config;
|
||||
|
||||
if (!isset($config['system']['gw_switch_default'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
$gateways_status = return_gateways_status(true);
|
||||
$gateways_arr = return_gateways_array();
|
||||
|
||||
foreach (array("inet", "inet6") as $ipprotocol) {
|
||||
$dfltgwname = null;
|
||||
$dfltgwip = null;
|
||||
@ -880,7 +889,7 @@ function fixup_default_gateway($gateways_status, $gateways_arr)
|
||||
/* wrong address family */
|
||||
continue;
|
||||
}
|
||||
if (!isset($gwsttng['monitoring_disabled']) && $gateways_status[$gwname]['status'] === 'down') {
|
||||
if (strpos($gateways_status[$gwname]['status'], 'down') !== false) {
|
||||
/* cannot use down gateway */
|
||||
continue;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user