summaryrefslogtreecommitdiffstats
path: root/src/etc/inc/itemid.inc
diff options
context:
space:
mode:
authorNOYB <Al_Stu@Frontier.com>2016-08-02 22:17:14 -0700
committerNOYB <Al_Stu@Frontier.com>2016-08-02 22:17:14 -0700
commit7475d7b337c0a08dc4d6636f33b0998067f26008 (patch)
treeb90c1610eceb0b75c8a3e479b45c67550a82d610 /src/etc/inc/itemid.inc
parentdeda621a345a74953a869252f58b25d032cac6c1 (diff)
downloadpfsense-7475d7b337c0a08dc4d6636f33b0998067f26008.zip
pfsense-7475d7b337c0a08dc4d6636f33b0998067f26008.tar.gz
Update firewall rules separators when NAT associated rule is deleted.
Bug: https://redmine.pfsense.org/issues/6676
Diffstat (limited to 'src/etc/inc/itemid.inc')
-rw-r--r--src/etc/inc/itemid.inc10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/etc/inc/itemid.inc b/src/etc/inc/itemid.inc
index 3538ccd..6251928 100644
--- a/src/etc/inc/itemid.inc
+++ b/src/etc/inc/itemid.inc
@@ -30,6 +30,8 @@
* boolean - true if item was found and deleted
******/
function delete_id($id, &$array) {
+ global $config;
+
// Index to delete
$delete_index = NULL;
@@ -42,6 +44,7 @@ function delete_id($id, &$array) {
// If this item is the one we want to delete
if (isset($item['associated-rule-id']) && $item['associated-rule-id'] == $id) {
$delete_index = $key;
+ $if = $item['interface'];
break;
}
}
@@ -49,6 +52,13 @@ function delete_id($id, &$array) {
// If we found the item, unset it
if ($delete_index !== NULL) {
unset($array[$delete_index]);
+
+ // Update the separators
+ $a_separators = &$config['filter']['separator'][strtolower($if)];
+ $ridx = ifridx($if, $delete_index); // get rule index within interface
+ $mvnrows = -1;
+ move_separators($a_separators, $ridx, $mvnrows);
+
return true;
} else {
return false;
OpenPOWER on IntegriCloud