35 lines
1.2 KiB
Diff
35 lines
1.2 KiB
Diff
From d96999931f66819db3f146f750a4c14997a50c27 Mon Sep 17 00:00:00 2001
|
|
From: Thomas Woerner <twoerner@redhat.com>
|
|
Date: Thu, 1 Feb 2018 16:44:21 +0100
|
|
Subject: [PATCH] firewall/core/fw_transaction.py: Remove deduplication in
|
|
add_rule
|
|
|
|
Loading services from permanent configuration containing the same port numbers
|
|
results in deduplication of the rules. This then results in an error if the
|
|
second service gets removed from the zone.
|
|
|
|
Fixes: RHBZ#1534571
|
|
Closes: #288
|
|
(cherry picked from commit 54835164f610593eedd71f0a7ae62ac5258d2187)
|
|
---
|
|
src/firewall/core/fw_transaction.py | 3 +--
|
|
1 file changed, 1 insertion(+), 2 deletions(-)
|
|
|
|
diff --git a/src/firewall/core/fw_transaction.py b/src/firewall/core/fw_transaction.py
|
|
index 4e284687..9f167c37 100644
|
|
--- a/src/firewall/core/fw_transaction.py
|
|
+++ b/src/firewall/core/fw_transaction.py
|
|
@@ -128,8 +128,7 @@ class SimpleFirewallTransaction(object):
|
|
self.generous_mode = False
|
|
|
|
def add_rule(self, ipv, rule):
|
|
- if ipv not in self.rules or rule not in self.rules[ipv]:
|
|
- self.rules.setdefault(ipv, [ ]).append(rule)
|
|
+ self.rules.setdefault(ipv, [ ]).append(rule)
|
|
|
|
def query_rule(self, ipv, rule):
|
|
return ipv in self.rules and rule in self.rules[ipv]
|
|
--
|
|
2.14.3
|
|
|