Bug 1182671

Summary: Can`t delete direct rule using firewall-cmd
Product: Red Hat Enterprise Linux 7 Reporter: Thomas Woerner <twoerner>
Component: firewalldAssignee: Thomas Woerner <twoerner>
Status: CLOSED ERRATA QA Contact: Tomas Dolezal <todoleza>
Severity: unspecified Docs Contact:
Priority: high    
Version: 7.0CC: extras-qa, jpopelka, jscotka, pvrabec, sergei.solomonov, todoleza, twoerner
Target Milestone: rcKeywords: Patch
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: An already removed permanent direct rule has been re-applied while reloading if it was applied in runtime before. Consequence: It was not possible to simply remove a permanent direct rule with a reload without removing the rule also in the runtime environment. Fix: Only direct rules added to runtime only are automatically re-applied while reloading. Direct rules in the permanent environment are also applied as before. Result: No already removed permenent direct rules after reload.
Story Points: ---
Clone Of: 1182641 Environment:
Last Closed: 2015-11-19 12:59:45 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1182641    
Bug Blocks:    

Description Thomas Woerner 2015-01-15 16:53:40 UTC
+++ This bug was initially created as a clone of Bug #1182641 +++

Description of problem:
Can`t delete direct rule using firewall-cmd tool

Version-Release number of selected component (if applicable):
version 0.3.13

How reproducible:


Steps to Reproduce:
# firewall-cmd --permanent --direct --add-rule ipv4 nat OUTPUT 0 -s 127.0.0.1 -d 127.0.0.1 -p tcp --dport 80 -j REDIRECT --to-ports 81
# firewall-cmd --reload
# firewall-cmd --permanent --direct --remove-rule ipv4 nat OUTPUT 0 -s 127.0.0.1 -d 127.0.0.1 -p tcp --dport 80 -j REDIRECT --to-ports 81
# firewall-cmd --permanent --direct --add-rule ipv4 nat OUTPUT 0 -s 127.0.0.1 -d 127.0.0.1 -p tcp --dport 80 -j REDIRECT --to-ports 82
# firewall-cmd --reload
# firewall-cmd --direct --get-all-rules
Actual results:
ipv4 nat OUTPUT 0 -s 127.0.0.1 -d 127.0.0.1 -p tcp --dport 80 -j REDIRECT --to-ports 81
ipv4 nat OUTPUT 0 -s 127.0.0.1 -d 127.0.0.1 -p tcp --dport 80 -j REDIRECT --to-ports 82

Expected results:
ipv4 nat OUTPUT 0 -s 127.0.0.1 -d 127.0.0.1 -p tcp --dport 80 -j REDIRECT --to-ports 82

Additional info:
Also tested on Oracle Enterprise Linux 7, version 0.3.9

--- Additional comment from Thomas Woerner on 2015-01-15 11:48:38 EST ---

Fixed upstream: https://git.fedorahosted.org/cgit/firewalld.git/commit/?id=133e8e7cc77dfe10269ac146f3c03810f50062dd

--- Additional comment from Thomas Woerner on 2015-01-15 11:52:36 EST ---

Permanent direct settings are not recognized as such while reloading firewalld after adding the settings to the permanent environment if firewalld has been reloaded after adding the settings in the first place and after they have been removed again from the permanent environment.

A new test has been added to firewall-cmd_test.sh for verification.

Comment 4 errata-xmlrpc 2015-11-19 12:59:45 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-2422.html