Project

General

Profile

Actions

Bug #17021

open

Port Forward associated rule option "pass" is unnecessarily creating firewall rule entries with incorrect attributes

Added by Jim Pingle 4 days ago. Updated 3 days ago.

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

100%

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

Description

When creating a port forward the "Filter rule association" option has the option for Pass which uses rdr pass rules instead of firewall rules.

However, when saving the rule it is creating an unnecessary firewall rule and storing the incorrect associated-rule-id value of pass inside that firewall rule.

When editing an existing port forward rule, firewall rules with associated-rule-id value of pass cause the actual Pass option to disappear from the drop-down list.

This diff stops the drop-down from being corrupted:

diff --git a/src/usr/local/www/firewall_nat_edit.php b/src/usr/local/www/firewall_nat_edit.php
index ac867c5d73..105e9e23f7 100644
--- a/src/usr/local/www/firewall_nat_edit.php
+++ b/src/usr/local/www/firewall_nat_edit.php
@@ -431,7 +431,7 @@ if (isset($id) && config_get_path("nat/rule/{$id}") && (!isset($_POST['dup']) ||
        $rule_association = 'associated-rule-id';

        foreach (get_filter_rules_list() as $filter_id => $filter_rule) {
-               if (isset($filter_rule['associated-rule-id'])) {
+               if (isset($filter_rule['associated-rule-id']) && ($filter_rule['associated-rule-id'] != 'pass')) {
                        $rulelist[$filter_rule['associated-rule-id']] = sprintf(gettext('Rule %s'), $filter_rule['descr']);

                        if ($filter_rule['associated-rule-id'] == $pconfig['associated-rule-id']) {

However the original bug needs fixed so those unnecessary rules are not created.

It might not be a bad idea to remove the bad rules as they wouldn't be hit (rdr pass bypasses firewall rule checks) and they have invalid content.

Actions #1

Updated by Marcos M 3 days ago

  • Status changed from New to Feedback
  • % Done changed from 0 to 100

Applied in changeset 471d69ffaac1a2754b8e2f05511c9a2303585c99. Show

Actions

Also available in: Atom