|
|
c8bceb |
From 1bff55e87dd4a65613222e437f794468b2f70048 Mon Sep 17 00:00:00 2001
|
|
|
c8bceb |
From: Eric Garver <eric@garver.life>
|
|
|
c8bceb |
Date: Mon, 18 Mar 2019 15:09:19 -0400
|
|
|
c8bceb |
Subject: [PATCH 22/23] fw_zone: forward-ports: only enable IP forwarding if
|
|
|
c8bceb |
toaddr used
|
|
|
c8bceb |
|
|
|
c8bceb |
Fixes: #335
|
|
|
c8bceb |
Fixes: rhbz 1679610
|
|
|
c8bceb |
(cherry picked from commit 01ad269d475f19048085e15178806671a83f6d44)
|
|
|
c8bceb |
---
|
|
|
c8bceb |
src/firewall/core/fw_zone.py | 5 +++--
|
|
|
c8bceb |
1 file changed, 3 insertions(+), 2 deletions(-)
|
|
|
c8bceb |
|
|
|
c8bceb |
diff --git a/src/firewall/core/fw_zone.py b/src/firewall/core/fw_zone.py
|
|
|
c8bceb |
index db90c32be540..d5eafb863439 100644
|
|
|
c8bceb |
--- a/src/firewall/core/fw_zone.py
|
|
|
c8bceb |
+++ b/src/firewall/core/fw_zone.py
|
|
|
c8bceb |
@@ -1702,7 +1702,7 @@ class FirewallZone(object):
|
|
|
c8bceb |
for ipv in ipvs:
|
|
|
c8bceb |
if backend.is_ipv_supported(ipv):
|
|
|
c8bceb |
self.check_forward_port(ipv, port, protocol, toport, toaddr)
|
|
|
c8bceb |
- if enable:
|
|
|
c8bceb |
+ if toaddr and enable:
|
|
|
c8bceb |
zone_transaction.add_post(enable_ip_forwarding, ipv)
|
|
|
c8bceb |
|
|
|
c8bceb |
if enable:
|
|
|
c8bceb |
@@ -1914,7 +1914,8 @@ class FirewallZone(object):
|
|
|
c8bceb |
zone_transaction.add_chain("nat", "PREROUTING")
|
|
|
c8bceb |
zone_transaction.add_chain("filter", filter_chain)
|
|
|
c8bceb |
|
|
|
c8bceb |
- zone_transaction.add_post(enable_ip_forwarding, ipv)
|
|
|
c8bceb |
+ if toaddr and enable:
|
|
|
c8bceb |
+ zone_transaction.add_post(enable_ip_forwarding, ipv)
|
|
|
c8bceb |
backend = self._fw.get_backend_by_ipv(ipv)
|
|
|
c8bceb |
rules = backend.build_zone_forward_port_rules(
|
|
|
c8bceb |
enable, zone, filter_chain, port, protocol, toport,
|
|
|
c8bceb |
--
|
|
|
c8bceb |
2.20.1
|
|
|
c8bceb |
|