summaryrefslogtreecommitdiffstats
path: root/src/etc/inc
diff options
context:
space:
mode:
authorNOYB <Al_Stu@Frontier.com>2016-02-08 02:12:47 -0800
committerNOYB <Al_Stu@Frontier.com>2016-02-08 22:11:42 -0800
commitfdb83ce0555487a4ba076aa40f9a1a4886259f22 (patch)
treeae23d112b1a78c5dfc2ca596ff73a9680059bbe9 /src/etc/inc
parent56ba82402a667f52a7cbcdab4c91cca33885301e (diff)
downloadpfsense-fdb83ce0555487a4ba076aa40f9a1a4886259f22.zip
pfsense-fdb83ce0555487a4ba076aa40f9a1a4886259f22.tar.gz
Firewall / Rules - Page Efficiency Upgrade
1) Only load the rules of the selected interface instead of loading all the rules of all interfaces and hiding them. Very inefficient and can result in sluggishness. Especially with large number of rules and/or large alias tables. 1.1) Rule separators indexed to their position within their interface so they work with only loading the selected interface rules. 2) Supports consecutive separators. 3) Fixes #5559 - horizontal scrollbar when no rules to display (all hidden). No longer hiding rules. 4) Corrects case where a single rule defined on any interface would prevent the alert messages from being displayed on all interfaces.
Diffstat (limited to 'src/etc/inc')
-rw-r--r--src/etc/inc/filter.inc17
-rw-r--r--src/etc/inc/globals.inc2
-rw-r--r--src/etc/inc/upgrade_config.inc31
3 files changed, 49 insertions, 1 deletions
diff --git a/src/etc/inc/filter.inc b/src/etc/inc/filter.inc
index efa0d09..f41c091 100644
--- a/src/etc/inc/filter.inc
+++ b/src/etc/inc/filter.inc
@@ -4236,4 +4236,21 @@ function filter_get_antilockout_ports($wantarray = false) {
}
+// get rule index within interface
+function ifridx($if, $ridx) {
+ global $config;
+
+ $i = $ifridx = 0;
+ foreach ($config['filter']['rule'] as $rulen => $filterent) {
+ if (($filterent['interface'] == $if && !isset($filterent['floating'])) || (isset($filterent['floating']) && "FloatingRules" == $if)) {
+ if ($i == $ridx) {
+ return $ifridx;
+ }
+ $ifridx++;
+ }
+ $i++;
+ }
+ return $i;
+}
+
?>
diff --git a/src/etc/inc/globals.inc b/src/etc/inc/globals.inc
index bcb4043..a9d2ef5 100644
--- a/src/etc/inc/globals.inc
+++ b/src/etc/inc/globals.inc
@@ -99,7 +99,7 @@ $g = array(
"disablecrashreporter" => false,
"crashreporterurl" => "https://crashreporter.pfsense.org/crash_reporter.php",
"debug" => false,
- "latest_config" => "14.2",
+ "latest_config" => "14.3",
"nopkg_platforms" => array("cdrom"),
"minimum_ram_warning" => "101",
"minimum_ram_warning_text" => "128 MB",
diff --git a/src/etc/inc/upgrade_config.inc b/src/etc/inc/upgrade_config.inc
index 0848d0e..d3abb0b 100644
--- a/src/etc/inc/upgrade_config.inc
+++ b/src/etc/inc/upgrade_config.inc
@@ -4410,4 +4410,35 @@ function upgrade_141_to_142() {
}
}
+function upgrade_142_to_143() {
+ global $config;
+ /* Index firewall rule separators per interface */
+
+ foreach ($config['filter']['separator'] as $interface => $separators) {
+
+ foreach ($separators as $sepn => $separator) {
+
+ $seprow = substr($separator['row']['0'], 2);
+ $sepif = $separator['if'];
+
+ // Determine position of separator within the interface rules.
+ $i = -1; $j = 0;
+ foreach ($config['filter']['rule'] as $rulen => $filterent) {
+
+ if ($i == $seprow) {
+ // Set separator row to it's position within the interface rules.
+ $config['filter']['separator'][$sepif][$sepn]['row'] = 'fr' . $j;
+ continue 2; // Advance to next separator
+ }
+
+ // Position within the interface rules.
+ if (($filterent['interface'] == $sepif && !isset($filterent['floating'])) || (isset($filterent['floating']) && "floatingrules" == $sepif)) {
+ $j++;
+ }
+ $i++;
+ }
+ }
+ }
+}
+
?>
OpenPOWER on IntegriCloud