Commit 3df63a5d authored by Franco Fichtner's avatar Franco Fichtner

filter: try to not call filter_generate_optcfg_array from...

everywhere, anytime, just for fun...  first of many :(
parent b980171c
...@@ -162,17 +162,15 @@ function filter_configure_sync($delete_states_if_needed = true) ...@@ -162,17 +162,15 @@ function filter_configure_sync($delete_states_if_needed = true)
global $config, $g, $after_filter_configure_run; global $config, $g, $after_filter_configure_run;
global $time_based_rules, $filterdns, $aliases; global $time_based_rules, $filterdns, $aliases;
$FilterIflist = filter_generate_optcfg_array() ; $FilterIflist = filter_generate_optcfg_array();
/* Use filter lock to not allow concurrent filter reloads during this run. */ /* Use filter lock to not allow concurrent filter reloads during this run. */
$filterlck = lock('filter', LOCK_EX); $filterlck = lock('filter', LOCK_EX);
filter_pflog_start(); filter_pflog_start();
update_filter_reload_status(gettext("Initializing"), true); update_filter_reload_status(gettext("Initializing"), true);
/* Get interface list to work with. */ /* Get interface list to work with. */
filter_generate_optcfg_array();
if(file_exists("/var/run/booting")) { if(file_exists("/var/run/booting")) {
echo gettext("Configuring firewall"); echo gettext("Configuring firewall");
} }
...@@ -182,7 +180,7 @@ function filter_configure_sync($delete_states_if_needed = true) ...@@ -182,7 +180,7 @@ function filter_configure_sync($delete_states_if_needed = true)
echo "."; echo ".";
} }
update_filter_reload_status(gettext("Creating aliases")); update_filter_reload_status(gettext("Creating aliases"));
$aliases = filter_generate_aliases(); $aliases = filter_generate_aliases($FilterIflist);
$gateways = filter_generate_gateways(); $gateways = filter_generate_gateways();
if(file_exists("/var/run/booting")) { if(file_exists("/var/run/booting")) {
echo "."; echo ".";
...@@ -515,10 +513,9 @@ function filter_expand_alias_array($alias_name) { ...@@ -515,10 +513,9 @@ function filter_expand_alias_array($alias_name) {
return explode(" ", preg_replace('/\s+/', ' ', trim($expansion))); return explode(" ", preg_replace('/\s+/', ' ', trim($expansion)));
} }
function filter_generate_aliases() function filter_generate_aliases($FilterIflist)
{ {
global $config, $after_filter_configure_run; global $config, $after_filter_configure_run;
$FilterIflist = filter_generate_optcfg_array() ;
$alias = "#System aliases\n "; $alias = "#System aliases\n ";
$aliases = "loopback = \"{ lo0 }\"\n"; $aliases = "loopback = \"{ lo0 }\"\n";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment