summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndris PE2023-10-14 09:51:00 +0000
committerJo-Philipp Wich2023-11-03 13:24:47 +0000
commit7392792e768b4d5c373f66ec400fd4100df1b4e0 (patch)
treec7212b710a7ad17ba19b923d9086229b740830cf
parentde3483c561a728d5234a0a3f49b5dde4527a0f3f (diff)
ruleset: do not emit redundant drop invalid rules
The wan interface drop rule unnecessarily persists when invalid state is dropped globally and the rule cannot catch anything at all, so remove it as the effect is achieved by default and to global extent. Fixes: 119ee1a ("ruleset: drop ctstate invalid traffic for masq-enabled zones") Signed-off-by: Andris PE <neandris@gmail.com> [fix S-o-b tag, fix commit author, reword commit subject and message] Signed-off-by: Jo-Philipp Wich <jo@mein.io>
-rw-r--r--root/usr/share/firewall4/templates/ruleset.uc2
1 files changed, 1 insertions, 1 deletions
diff --git a/root/usr/share/firewall4/templates/ruleset.uc b/root/usr/share/firewall4/templates/ruleset.uc
index 4210d64..bcfd0d5 100644
--- a/root/usr/share/firewall4/templates/ruleset.uc
+++ b/root/usr/share/firewall4/templates/ruleset.uc
@@ -276,7 +276,7 @@ table inet fw4 {
{% if (zone.dflags[verdict]): %}
chain {{ verdict }}_to_{{ zone.name }} {
{% for (let rule in zone.match_rules): %}
-{% if (verdict == "accept" && (zone.masq || zone.masq6) && !zone.masq_allow_invalid): %}
+{% if (!fw4.default_option("drop_invalid") && verdict == "accept" && (zone.masq || zone.masq6) && !zone.masq_allow_invalid): %}
{%+ include("zone-drop-invalid.uc", { fw4, zone, rule }) %}
{% endif %}
{%+ include("zone-verdict.uc", { fw4, zone, rule, egress: true, verdict }) %}