Blame SOURCES/0092-fix-nftables-forward-ports-should-only-affect-IPv4.patch

c8bceb
From 4618c4f00b7849e4e253329e9f40fbd20b6160a3 Mon Sep 17 00:00:00 2001
c8bceb
From: Eric Garver <eric@garver.life>
c8bceb
Date: Fri, 23 Aug 2019 14:56:28 -0400
c8bceb
Subject: [PATCH 92/99] fix: nftables: --forward-ports should only affect IPv4
c8bceb
c8bceb
As per man page. User should use rich rules for IPv6 forward ports.
c8bceb
c8bceb
(cherry picked from commit 816f62a294245b4ba67fdf794dc3caebad50d5b5)
c8bceb
(cherry picked from commit df065ab7853b75ff266deb495b79c9919a2608cd)
c8bceb
---
c8bceb
 src/firewall/core/nftables.py | 4 ++--
c8bceb
 1 file changed, 2 insertions(+), 2 deletions(-)
c8bceb
c8bceb
diff --git a/src/firewall/core/nftables.py b/src/firewall/core/nftables.py
c8bceb
index baa6a7f58cfb..9d88e72f42bf 100644
c8bceb
--- a/src/firewall/core/nftables.py
c8bceb
+++ b/src/firewall/core/nftables.py
c8bceb
@@ -1040,10 +1040,10 @@ class nftables(object):
c8bceb
             rules.extend(self._build_zone_forward_port_nat_rules(enable, zone,
c8bceb
                                 protocol, mark_fragment, toaddr, toport, "ip"))
c8bceb
         else:
c8bceb
-            if not toaddr or check_single_address("ipv6", toaddr):
c8bceb
+            if toaddr and check_single_address("ipv6", toaddr):
c8bceb
                 rules.extend(self._build_zone_forward_port_nat_rules(enable, zone,
c8bceb
                                     protocol, mark_fragment, toaddr, toport, "ip6"))
c8bceb
-            if not toaddr or check_single_address("ipv4", toaddr):
c8bceb
+            else:
c8bceb
                 rules.extend(self._build_zone_forward_port_nat_rules(enable, zone,
c8bceb
                                     protocol, mark_fragment, toaddr, toport, "ip"))
c8bceb
 
c8bceb
-- 
c8bceb
2.20.1
c8bceb