Blame SOURCES/0062-fix-rich-rule-destination-with-services.patch

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