|
Pablo Greco |
0eb613 |
From 9cd642933d41a983c4cbdef6aa936151e89a05ef Mon Sep 17 00:00:00 2001
|
|
Pablo Greco |
0eb613 |
From: Eric Garver <eric@garver.life>
|
|
Pablo Greco |
0eb613 |
Date: Thu, 6 Jun 2019 12:25:08 -0400
|
|
Pablo Greco |
0eb613 |
Subject: [PATCH] fix: rich rule destination with services
|
|
Pablo Greco |
0eb613 |
|
|
Pablo Greco |
0eb613 |
Fixes: rhbz 1715977
|
|
Pablo Greco |
0eb613 |
(cherry picked from commit d3bd517c7deb44d42129017b3c471ccdf1c32b57)
|
|
Pablo Greco |
0eb613 |
---
|
|
Pablo Greco |
0eb613 |
src/firewall/core/fw_zone.py | 7 ++++---
|
|
Pablo Greco |
0eb613 |
1 file changed, 4 insertions(+), 3 deletions(-)
|
|
Pablo Greco |
0eb613 |
|
|
Pablo Greco |
0eb613 |
diff --git a/src/firewall/core/fw_zone.py b/src/firewall/core/fw_zone.py
|
|
Pablo Greco |
0eb613 |
index 90ae1036..1f33b550 100644
|
|
Pablo Greco |
0eb613 |
--- a/src/firewall/core/fw_zone.py
|
|
Pablo Greco |
0eb613 |
+++ b/src/firewall/core/fw_zone.py
|
|
Pablo Greco |
0eb613 |
@@ -1582,17 +1582,18 @@ def _rule_prepare(self, enable, zone, rule, mark_id, zone_transaction):
|
|
Pablo Greco |
0eb613 |
if type(rule.element) == Rich_Service:
|
|
Pablo Greco |
0eb613 |
svc = self._fw.service.get_service(rule.element.name)
|
|
Pablo Greco |
0eb613 |
|
|
Pablo Greco |
0eb613 |
- destinations = [rule.destination] if rule.destination else [None]
|
|
Pablo Greco |
0eb613 |
-
|
|
Pablo Greco |
0eb613 |
+ destinations = []
|
|
Pablo Greco |
0eb613 |
if len(svc.destination) > 0:
|
|
Pablo Greco |
0eb613 |
if rule.destination:
|
|
Pablo Greco |
0eb613 |
# we can not use two destinations at the same time
|
|
Pablo Greco |
0eb613 |
raise FirewallError(errors.INVALID_RULE,
|
|
Pablo Greco |
0eb613 |
"Destination conflict with service.")
|
|
Pablo Greco |
0eb613 |
- destinations = []
|
|
Pablo Greco |
0eb613 |
for ipv in ipvs:
|
|
Pablo Greco |
0eb613 |
if ipv in svc.destination and backend.is_ipv_supported(ipv):
|
|
Pablo Greco |
0eb613 |
destinations.append(svc.destination[ipv])
|
|
Pablo Greco |
0eb613 |
+ else:
|
|
Pablo Greco |
0eb613 |
+ # dummy for the following for loop
|
|
Pablo Greco |
0eb613 |
+ destinations.append(None)
|
|
Pablo Greco |
0eb613 |
|
|
Pablo Greco |
0eb613 |
for destination in destinations:
|
|
Pablo Greco |
0eb613 |
if enable:
|