Blame SOURCES/0011-nftables-fix-rich-rule-masquerade.patch

21c891
From 93a281423cd0041fc4c5061fdced9cadb1e785a1 Mon Sep 17 00:00:00 2001
21c891
From: Eric Garver <e@erig.me>
21c891
Date: Wed, 5 Dec 2018 17:16:30 -0500
21c891
Subject: [PATCH 11/34] nftables: fix rich rule masquerade
21c891
21c891
(cherry picked from commit aee4948e86fde6df8205b07f4da58e2a8c07377c)
21c891
(cherry picked from commit d7b9c1c646c07c24dd44e9e2792d0c6471d54c1b)
21c891
---
21c891
 src/firewall/core/nftables.py | 7 +++----
21c891
 1 file changed, 3 insertions(+), 4 deletions(-)
21c891
21c891
diff --git a/src/firewall/core/nftables.py b/src/firewall/core/nftables.py
21c891
index 44cd4f9e1752..00a02ad149e5 100644
21c891
--- a/src/firewall/core/nftables.py
21c891
+++ b/src/firewall/core/nftables.py
21c891
@@ -900,7 +900,6 @@ class nftables(object):
21c891
 
21c891
         rule_fragment = []
21c891
         if rich_rule:
21c891
-            rule_fragment += self._rich_rule_family_fragment(rich_rule.family)
21c891
             rule_fragment += self._rich_rule_destination_fragment(rich_rule.destination)
21c891
             rule_fragment += self._rich_rule_source_fragment(rich_rule.source)
21c891
 
21c891
@@ -912,10 +911,10 @@ class nftables(object):
21c891
         # nat tables needs to use ip/ip6 family
21c891
         rules = []
21c891
         if rich_rule and (rich_rule.family and rich_rule.family == "ipv6"
21c891
-           or rich_rule.source and check_address("ipv6", rich_rule.source)):
21c891
+           or rich_rule.source and check_address("ipv6", rich_rule.source.addr)):
21c891
             rules.extend(self._build_zone_masquerade_nat_rules(enable, zone, "ip6", rich_rule))
21c891
-        if rich_rule and (rich_rule.family and rich_rule.family == "ipv4"
21c891
-           or rich_rule.source and check_address("ipv4", rich_rule.source)):
21c891
+        elif rich_rule and (rich_rule.family and rich_rule.family == "ipv4"
21c891
+           or rich_rule.source and check_address("ipv4", rich_rule.source.addr)):
21c891
             rules.extend(self._build_zone_masquerade_nat_rules(enable, zone, "ip", rich_rule))
21c891
         else:
21c891
             rules.extend(self._build_zone_masquerade_nat_rules(enable, zone, "ip6", rich_rule))
21c891
-- 
21c891
2.18.0
21c891