Commit cd8490ae authored by Franco Fichtner's avatar Franco Fichtner

filter: minor style issues

(cherry picked from commit 04a1d6c4)
(cherry picked from commit 9385d1fb)
parent 52c87404
...@@ -393,7 +393,6 @@ function filter_configure_sync() ...@@ -393,7 +393,6 @@ function filter_configure_sync()
if (file_exists("/var/run/booting")) { if (file_exists("/var/run/booting")) {
echo "."; echo ".";
} }
update_filter_reload_status(gettext("Generating Limiter rules"));
update_filter_reload_status(gettext("Generating NAT rules")); update_filter_reload_status(gettext("Generating NAT rules"));
/* generate nat rules */ /* generate nat rules */
$natrules = filter_nat_rules_generate($FilterIflist); $natrules = filter_nat_rules_generate($FilterIflist);
...@@ -740,7 +739,7 @@ function filter_generate_aliases(&$FilterIflist, &$after_filter_configure_run) ...@@ -740,7 +739,7 @@ function filter_generate_aliases(&$FilterIflist, &$after_filter_configure_run)
{ {
global $config; global $config;
$aliases = "#System aliases\n"; $aliases = "# System aliases\n";
$aliases .= "loopback = \"{ lo0 }\"\n"; $aliases .= "loopback = \"{ lo0 }\"\n";
foreach ($FilterIflist as $if => $ifcfg) { foreach ($FilterIflist as $if => $ifcfg) {
...@@ -937,7 +936,7 @@ function filter_get_direct_networks_list(&$FilterIflist, $returnsubnetsonly = tr ...@@ -937,7 +936,7 @@ function filter_get_direct_networks_list(&$FilterIflist, $returnsubnetsonly = tr
if (is_subnet($subnet) && !(is_subnetv4($subnet) && $vip['subnet_bits'] == 32) && !(is_subnetv6($subnet) && $vip['subnet_bits'] == 128)) { if (is_subnet($subnet) && !(is_subnetv4($subnet) && $vip['subnet_bits'] == 32) && !(is_subnetv6($subnet) && $vip['subnet_bits'] == 128)) {
if (is_subnetv4($subnet)) { if (is_subnetv4($subnet)) {
$subnet = gen_subnet($vip['subnet'], $vip['subnet_bits']) . "/{$vip['subnet_bits']}"; $subnet = gen_subnet($vip['subnet'], $vip['subnet_bits']) . "/{$vip['subnet_bits']}";
} else if (is_subnetv6($subnet)) { } elseif (is_subnetv6($subnet)) {
$subnet = gen_subnetv6($vip['subnet'], $vip['subnet_bits']) . "/{$vip['subnet_bits']}"; $subnet = gen_subnetv6($vip['subnet'], $vip['subnet_bits']) . "/{$vip['subnet_bits']}";
} }
if ($returnsubnetsonly) { if ($returnsubnetsonly) {
...@@ -954,7 +953,7 @@ function filter_get_direct_networks_list(&$FilterIflist, $returnsubnetsonly = tr ...@@ -954,7 +953,7 @@ function filter_get_direct_networks_list(&$FilterIflist, $returnsubnetsonly = tr
if (is_subnet($netent['network'])) { if (is_subnet($netent['network'])) {
if ($returnsubnetsonly) { if ($returnsubnetsonly) {
$networks_arr[] = $netent['network']; $networks_arr[] = $netent['network'];
} else if (isset($GatewaysList[$netent['gateway']])) { } elseif (isset($GatewaysList[$netent['gateway']])) {
$networks_arr[] = array( $networks_arr[] = array(
'subnet' => $netent['network'], 'subnet' => $netent['network'],
'if' => $GatewaysList[$netent['gateway']]['friendlyiface'], 'if' => $GatewaysList[$netent['gateway']]['friendlyiface'],
...@@ -1081,7 +1080,7 @@ function filter_generate_optcfg_array() ...@@ -1081,7 +1080,7 @@ function filter_generate_optcfg_array()
} else { } else {
$oic['vips'][$vipidx]['sn'] = $vip['subnet_bits']; $oic['vips'][$vipidx]['sn'] = $vip['subnet_bits'];
} }
} else if (is_ipaddrv6($vip['subnet'])) { } elseif (is_ipaddrv6($vip['subnet'])) {
if (!is_array($oic['vips6'])) { if (!is_array($oic['vips6'])) {
$oic['vips6'] = array(); $oic['vips6'] = array();
} }
...@@ -1719,14 +1718,14 @@ function filter_nat_rules_generate(&$FilterIflist) ...@@ -1719,14 +1718,14 @@ function filter_nat_rules_generate(&$FilterIflist)
$alintrf = null; $alintrf = null;
} }
if (!empty($alintrf) ) { if (!empty($alintrf) ) {
$natrules .= "# Anti lockout, prevent redirects for protected ports to this interface ip \n"; $natrules .= "\n# Anti lockout, prevent redirects for protected ports to this interface ip \n";
$natrules .= "no rdr on {$alintrf} proto tcp from any to ( {$alintrf} ) port { {$alports} } "; $natrules .= "no rdr on {$alintrf} proto tcp from any to ( {$alintrf} ) port { {$alports} }\n";
} }
unset($alports); unset($alports);
} }
if (isset($config['nat']['rule'])) { if (isset($config['nat']['rule'])) {
$natrules .= "# NAT Inbound Redirects\n"; $natrules .= "\n# NAT Inbound Redirects\n";
foreach ($config['nat']['rule'] as $rule) { foreach ($config['nat']['rule'] as $rule) {
update_filter_reload_status(sprintf(gettext("Creating NAT rule %s"), $rule['descr'])); update_filter_reload_status(sprintf(gettext("Creating NAT rule %s"), $rule['descr']));
...@@ -1746,7 +1745,7 @@ function filter_nat_rules_generate(&$FilterIflist) ...@@ -1746,7 +1745,7 @@ function filter_nat_rules_generate(&$FilterIflist)
$localport = alias_expand($rule['local-port']); $localport = alias_expand($rule['local-port']);
if (!$localport || $dstport[0] == $localport) { if (!$localport || $dstport[0] == $localport) {
$localport = ""; $localport = "";
} else if (is_alias($rule['local-port'])) { } elseif (is_alias($rule['local-port'])) {
$localport = filter_expand_alias($rule['local-port']); $localport = filter_expand_alias($rule['local-port']);
if ($localport) { if ($localport) {
$localport = explode(" ", trim($localport)); $localport = explode(" ", trim($localport));
...@@ -2895,7 +2894,7 @@ EOD; ...@@ -2895,7 +2894,7 @@ EOD;
$rule_arr1[] = filter_generate_user_rule_arr($FilterIflist, $rule); $rule_arr1[] = filter_generate_user_rule_arr($FilterIflist, $rule);
$rule['ipprotocol'] = "inet6"; $rule['ipprotocol'] = "inet6";
$rule_arr1[] = filter_generate_user_rule_arr($FilterIflist, $rule); $rule_arr1[] = filter_generate_user_rule_arr($FilterIflist, $rule);
} else if (is_interface_group($rule['interface']) || in_array($rule['interface'], $vpn_and_ppp_ifs)) { } elseif (is_interface_group($rule['interface']) || in_array($rule['interface'], $vpn_and_ppp_ifs)) {
$rule['ipprotocol'] = "inet"; $rule['ipprotocol'] = "inet";
$rule_arr2[] = filter_generate_user_rule_arr($FilterIflist, $rule); $rule_arr2[] = filter_generate_user_rule_arr($FilterIflist, $rule);
$rule['ipprotocol'] = "inet6"; $rule['ipprotocol'] = "inet6";
......
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