mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-14 00:24:40 +00:00
system: reorder routing calls for #1821
In order for default gateway switching to work we need to call routing first, then set up gateways, lastly invoke filter reload which currently chains the gateway swtich code. While here, remove deprecation notes.
This commit is contained in:
parent
4f955e4f7c
commit
b30cbe1570
@ -323,7 +323,6 @@ function filter_configure_sync($verbose = false)
|
||||
flush();
|
||||
}
|
||||
|
||||
/* XXX deprectated feature, only called on reconfigure */
|
||||
if (isset($config['system']['gw_switch_default'])) {
|
||||
$gateways_status = return_gateways_status(true);
|
||||
$gateways_arr = return_gateways_array();
|
||||
|
||||
@ -554,8 +554,6 @@ function system_routing_configure($interface = '', $verbose = false)
|
||||
if ($verbose) {
|
||||
echo "done.\n";
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -127,9 +127,9 @@ function filter_configure_xmlrpc()
|
||||
require_once("services.inc");
|
||||
require_once("rrd.inc");
|
||||
|
||||
filter_configure();
|
||||
system_routing_configure();
|
||||
setup_gateways_monitor();
|
||||
filter_configure();
|
||||
system_hosts_generate();
|
||||
local_sync_accounts();
|
||||
plugins_configure('dns');
|
||||
|
||||
@ -43,5 +43,5 @@ foreach (glob("/tmp/delete_route_*.todo") as $filename) {
|
||||
}
|
||||
|
||||
system_routing_configure('', true);
|
||||
filter_configure_sync(true);
|
||||
setup_gateways_monitor(true);
|
||||
filter_configure_sync(true);
|
||||
|
||||
@ -525,12 +525,10 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
|
||||
plugins_configure('newwanip');
|
||||
|
||||
/* sync filter configuration */
|
||||
system_routing_configure();
|
||||
setup_gateways_monitor();
|
||||
filter_configure();
|
||||
rrd_configure();
|
||||
if (is_subsystem_dirty('staticroutes') && (system_routing_configure() == 0)) {
|
||||
clear_subsystem_dirty('staticroutes');
|
||||
}
|
||||
}
|
||||
@unlink('/tmp/.interfaces.apply');
|
||||
header(url_safe('Location: /interfaces.php?if=%s', array($if)));
|
||||
|
||||
@ -368,7 +368,7 @@ include("head.inc");
|
||||
<input name="gw_switch_default" type="checkbox" id="gw_switch_default" value="yes" <?= !empty($pconfig['gw_switch_default']) ? 'checked="checked"' : '' ?> />
|
||||
<strong><?=gettext("Allow default gateway switching"); ?></strong><br />
|
||||
<output class="hidden" for="help_for_gw_switch_default">
|
||||
<?= gettext('If the link where the default gateway resides fails switch the default gateway to another available one. This feature has been deprecated.') ?>
|
||||
<?= gettext('If the link where the default gateway resides fails switch the default gateway to another available one.') ?>
|
||||
</output>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@ -52,20 +52,14 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
exit;
|
||||
}
|
||||
} elseif (isset($_POST['apply'])) {
|
||||
$retval = 0;
|
||||
$retval = system_routing_configure();
|
||||
system_routing_configure();
|
||||
clear_subsystem_dirty('staticroutes');
|
||||
setup_gateways_monitor();
|
||||
|
||||
configd_run('dyndns reload');
|
||||
configd_run('rfc2136 reload');
|
||||
configd_run('filter reload');
|
||||
|
||||
/* reconfigure our gateway monitor */
|
||||
setup_gateways_monitor();
|
||||
|
||||
if ($retval == 0) {
|
||||
clear_subsystem_dirty('staticroutes');
|
||||
}
|
||||
|
||||
foreach ($a_gateway_groups as $gateway_group) {
|
||||
$gw_subsystem = 'gwgroup.' . $gateway_group['name'];
|
||||
if (is_subsystem_dirty($gw_subsystem)) {
|
||||
@ -73,6 +67,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
clear_subsystem_dirty($gw_subsystem);
|
||||
}
|
||||
}
|
||||
|
||||
header(url_safe('Location: /system_gateway_groups.php'));
|
||||
exit;
|
||||
}
|
||||
|
||||
@ -129,14 +129,10 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
}
|
||||
if (isset($pconfig['apply'])) {
|
||||
// apply changes, reconfigure
|
||||
$retval = 0;
|
||||
$retval = system_routing_configure();
|
||||
filter_configure();
|
||||
/* reconfigure our gateway monitor */
|
||||
system_routing_configure();
|
||||
clear_subsystem_dirty('staticroutes');
|
||||
setup_gateways_monitor();
|
||||
if ($retval == 0) {
|
||||
clear_subsystem_dirty('staticroutes');
|
||||
}
|
||||
filter_configure();
|
||||
header(url_safe('Location: /system_gateways.php?displaysave=true'));
|
||||
exit;
|
||||
} elseif (isset($id) && isset($pconfig['act']) && $pconfig['act'] == "del") {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user