summaryrefslogtreecommitdiffstats
path: root/src/usr/local/www/firewall_nat.php
diff options
context:
space:
mode:
authorSteve Beaver <sbeaver@netgate.com>2016-09-21 13:46:19 -0400
committerSteve Beaver <sbeaver@netgate.com>2016-09-21 13:46:19 -0400
commit4b0815f38a8a0f98519ca0c2bff7c81b6464e579 (patch)
tree0997d086834715570b5c622570427fa92dc4a43d /src/usr/local/www/firewall_nat.php
parent00098bc80b6f85eb74f2f3bc2b4eb7430614110d (diff)
downloadpfsense-4b0815f38a8a0f98519ca0c2bff7c81b6464e579.zip
pfsense-4b0815f38a8a0f98519ca0c2bff7c81b6464e579.tar.gz
Apply #601 fix to firewall_nat.php
Diffstat (limited to 'src/usr/local/www/firewall_nat.php')
-rw-r--r--src/usr/local/www/firewall_nat.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/usr/local/www/firewall_nat.php b/src/usr/local/www/firewall_nat.php
index 71cd143..0a6dfcb 100644
--- a/src/usr/local/www/firewall_nat.php
+++ b/src/usr/local/www/firewall_nat.php
@@ -129,6 +129,7 @@ if (isset($_POST['del_x'])) {
/* delete selected rules */
if (is_array($_POST['rule']) && count($_POST['rule'])) {
$a_separators = &$config['nat']['separator'];
+ $num_deleted = 0;
foreach ($_POST['rule'] as $rulei) {
$target = $rule['target'];
@@ -136,16 +137,17 @@ if (isset($_POST['del_x'])) {
// Check for filter rule associations
if (isset($a_nat[$rulei]['associated-rule-id'])) {
delete_id($a_nat[$rulei]['associated-rule-id'], $config['filter']['rule']);
-
mark_subsystem_dirty('filter');
}
unset($a_nat[$rulei]);
// Update the separators
- $ridx = $rulei;
+ // As rules are deleted, $ridx has to be decremented or separator position will break
+ $ridx = $rulei - $num_deleted;
$mvnrows = -1;
move_separators($a_separators, $ridx, $mvnrows);
+ $num_deleted++;
}
if (write_config()) {
OpenPOWER on IntegriCloud