Commit b4ef16cb authored by Franco Fichtner's avatar Franco Fichtner

filter: this one has an external call-site :(

parent a3474575
...@@ -1363,9 +1363,9 @@ function filter_generate_reflection_proxy($rule, $nordr, $rdr_ifs, $srcaddr, $ds ...@@ -1363,9 +1363,9 @@ function filter_generate_reflection_proxy($rule, $nordr, $rdr_ifs, $srcaddr, $ds
return $natrules; return $natrules;
} }
function filter_nat_rules_automatic_tonathosts($with_descr = false) { function filter_nat_rules_automatic_tonathosts(&$filterIflist, $with_descr = false)
{
global $config, $GatewaysList; global $config, $GatewaysList;
$FilterIflist = filter_generate_optcfg_array() ;
$tonathosts = array("127.0.0.0/8"); $tonathosts = array("127.0.0.0/8");
$descriptions = array(gettext("localhost")); $descriptions = array(gettext("localhost"));
...@@ -1835,7 +1835,7 @@ function filter_nat_rules_generate(&$FilterIflist) ...@@ -1835,7 +1835,7 @@ function filter_nat_rules_generate(&$FilterIflist)
$natrules .= "\n# Outbound NAT rules (automatic)\n"; $natrules .= "\n# Outbound NAT rules (automatic)\n";
/* standard outbound rules (one for each interface) */ /* standard outbound rules (one for each interface) */
update_filter_reload_status(gettext("Creating outbound NAT rules")); update_filter_reload_status(gettext("Creating outbound NAT rules"));
$tonathosts_array = filter_nat_rules_automatic_tonathosts(); $tonathosts_array = filter_nat_rules_automatic_tonathosts($FilterIflist);
$tonathosts = implode(" ", $tonathosts_array); $tonathosts = implode(" ", $tonathosts_array);
$numberofnathosts = count($tonathosts_array); $numberofnathosts = count($tonathosts_array);
......
...@@ -74,7 +74,8 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { ...@@ -74,7 +74,8 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
if(empty($GatewaysList)) { if(empty($GatewaysList)) {
filter_generate_gateways(); filter_generate_gateways();
} }
$tonathosts = filter_nat_rules_automatic_tonathosts(true); /* XXX cranky low-level call, please refactor */
$tonathosts = filter_nat_rules_automatic_tonathosts(filter_generate_optcfg_array(), true);
$automatic_rules = filter_nat_rules_outbound_automatic(""); $automatic_rules = filter_nat_rules_outbound_automatic("");
foreach ($tonathosts as $tonathost) { foreach ($tonathosts as $tonathost) {
...@@ -479,7 +480,8 @@ include("head.inc"); ...@@ -479,7 +480,8 @@ include("head.inc");
if ($mode == "automatic" || $mode == "hybrid"): if ($mode == "automatic" || $mode == "hybrid"):
if(empty($GatewaysList)) if(empty($GatewaysList))
filter_generate_gateways(); filter_generate_gateways();
$automatic_rules = filter_nat_rules_outbound_automatic(implode(" ", filter_nat_rules_automatic_tonathosts())); /* XXX cranky low-level call, please refactor */
$automatic_rules = filter_nat_rules_outbound_automatic(implode(" ", filter_nat_rules_automatic_tonathosts(filter_generate_optcfg_array())));
unset($GatewaysList); unset($GatewaysList);
?> ?>
<section class="col-xs-12"> <section class="col-xs-12">
......
...@@ -171,6 +171,7 @@ if ($_POST) { ...@@ -171,6 +171,7 @@ if ($_POST) {
} }
} }
} }
/* XXX cranky low-level call, please refactor */
$direct_networks_list = explode(' ', filter_get_direct_networks_list(filter_generate_optcfg_array())); $direct_networks_list = explode(' ', filter_get_direct_networks_list(filter_generate_optcfg_array()));
for ($dnscounter=1; $dnscounter<5; $dnscounter++) { for ($dnscounter=1; $dnscounter<5; $dnscounter++) {
$dnsitem = "dns{$dnscounter}"; $dnsitem = "dns{$dnscounter}";
......
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