Project

General

Profile

Actions

Bug #16076

closed

Deleting or adding a firewall rule may result in an unexpected rule order

Added by Craig . about 2 months ago. Updated 28 days ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Rules / NAT
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
Plus Target Version:
25.03
Release Notes:
Default
Affected Version:
Affected Architecture:

Description

There seems to be an issue with firewall rules being re-ordered after using the red (multiple) "Delete" button, even when only a single firewall rule was deleted with it.

  • 1.png = 1,2,3,4,5,6,7,8,9,10
  • 2.png = (* is rules selected) 1,2*,3,4,5,6,7*,8,9,10
  • 3.png = (after delete) 8,9,10,1,2,3,4,5,6
  • 4.png = 3 is deleted using the delete button on the rule line itself (rule order doesn't change)
  • 5.png = (* is rules selected) 8,9*,10,1,2,4*,5,6
  • 6.png = (after delete) 10,1,2,5,6,8
  • 7.png = (* is rules selected) 10*,1,2,5,6,8*
  • 8.png = (after delete) 1,2,5,6
  • 9.png = (* is a single rule selected) 1,2*,5,6
  • 10.png = (after delete) 5,6,1

Files

10.png (24.7 KB) 10.png Craig ., 03/02/2025 05:44 AM
9.png (29.4 KB) 9.png Craig ., 03/02/2025 05:44 AM
8.png (28.6 KB) 8.png Craig ., 03/02/2025 05:44 AM
6.png (36.2 KB) 6.png Craig ., 03/02/2025 05:44 AM
7.png (37.5 KB) 7.png Craig ., 03/02/2025 05:44 AM
5.png (45.2 KB) 5.png Craig ., 03/02/2025 05:44 AM
4.png (44 KB) 4.png Craig ., 03/02/2025 05:44 AM
3.png (47.7 KB) 3.png Craig ., 03/02/2025 05:44 AM
2.png (52.2 KB) 2.png Craig ., 03/02/2025 05:44 AM
1.png (51.5 KB) 1.png Craig ., 03/02/2025 05:44 AM
Actions #1

Updated by Craig . about 2 months ago

Sorry, 2.png should = 1,2,3,4,5,6,7*,8,9,10

Actions #2

Updated by Marcos M about 1 month ago

  • Project changed from pfSense Plus to pfSense
  • Subject changed from Rule order is changing after using the 'multiple delete' button to Deleting a firewall rule may result in an unexpected rule order
  • Category changed from Rules / NAT to Rules / NAT
  • Status changed from New to In Progress
  • Assignee set to Marcos M
  • Target version set to 2.8.0
  • Affected Plus Version deleted (24.11)
  • Plus Target Version set to 25.03
Actions #3

Updated by Marcos M about 1 month ago

  • Status changed from In Progress to Feedback
  • % Done changed from 0 to 100

This regressed after the fix for https://redmine.pfsense.org/issues/15935 which added the call to filter_rules_sort() which exposed the reported issue.

This should be fixed with c181ebe180017116626da28f30407a1da3cba061.

Note that the issue only applies when MIM is not running/disabled.

Actions #4

Updated by Marcos M about 1 month ago

  • Subject changed from Deleting a firewall rule may result in an unexpected rule order to Deleting or adding a firewall rule may result in an unexpected rule order
There's an additional issue here when adding a rule at the top (i.e. when using the "up arrow Add" button) - the rule ends up being inserted at index 0. To reproduce:
  1. Set up 4 rules on each interface - Ethernet, Floating, WAN, and LAN - with a separator between rule 2 and 4.
  2. On LAN, add a rule using the up-arrow Add button; save but don't apply changes.
    • This clobbers the Ethernet/Floating rules order and index (see id in the URL for each rule).

This issue is fixed with 6664dd6d2268c91f48a71b565201fa52e3e3db97

The fixes have been added to the System Patches package for 24.11.

Actions #5

Updated by Marcos M about 1 month ago

  • Status changed from Feedback to Resolved
Actions #6

Updated by Marcos M about 1 month ago

  • Status changed from Resolved to Feedback

A fix has been committed for an issue with Ethernet rules (details on the forum).

Actions #7

Updated by Jordan G about 1 month ago

with above patch applied (on 24.11) and MIM disabled, deleting multiple firewall rules by selecting desired rules and using the delete button does not appear to have any adverse effect on the existing order of the remaining rules.

Actions #8

Updated by Marcos M 28 days ago

  • Status changed from Feedback to Resolved
Actions

Also available in: Atom PDF