From 4567dda1435a99d3d13efb8592915fbbfb9e7aa0 Mon Sep 17 00:00:00 2001
From: Eric Garver <eric@garver.life>
Date: Wed, 15 Jan 2020 10:41:29 -0500
Subject: [PATCH 130/146] fix: rich: source/dest only matching with mark action
We need to make sure the pre-requisite chains exist before generating
the rule for the mark action.
Fixes: #567
(cherry picked from commit 4997385a269b2128281f346ba6e049a41767d165)
(cherry picked from commit 349ae54987fcdd9361be9d365f2bc42b3f28cb2b)
---
src/firewall/core/fw_zone.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/firewall/core/fw_zone.py b/src/firewall/core/fw_zone.py
index b1dcce240063..56b0d54c1f19 100644
--- a/src/firewall/core/fw_zone.py
+++ b/src/firewall/core/fw_zone.py
@@ -1762,6 +1762,8 @@ class FirewallZone(object):
elif rule.element is None:
if enable:
zone_transaction.add_chain("filter", "INPUT")
+ if enable and type(rule.action) == Rich_Mark:
+ zone_transaction.add_chain("mangle", "PREROUTING")
rules = backend.build_zone_rich_source_destination_rules(
enable, zone, rule)
--
2.23.0