ruleset: fix undeclared variable access uncovered by strict mode
authorJo-Philipp Wich <jo@mein.io>
Fri, 28 Jan 2022 11:06:16 +0000 (12:06 +0100)
committerJo-Philipp Wich <jo@mein.io>
Fri, 28 Jan 2022 11:06:16 +0000 (12:06 +0100)
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
root/usr/share/firewall4/templates/ruleset.uc

index e9692d787675b594fcfa396fc6c2272714d13824..004cfca6bfb9bcfec926276ba412245237cdb943 100644 (file)
@@ -274,7 +274,7 @@ table inet fw4 {
 {%     if (rule.devices_neg || rule.subnets_neg || devices_pos || subnets_pos): %}
                {%+ if (rule.family): -%}
                        meta nfproto {{ fw4.nfproto(rule.family) }} {%+ endif -%}
-               {%+ include("zone-match.uc", { fw4, rule: { ...rule, devices_pos, subnets_pos } }) -%}
+               {%+ include("zone-match.uc", { fw4, egress: false, rule: { ...rule, devices_pos, subnets_pos } }) -%}
                jump {{ target }}_{{ zone.name }} comment "!fw4: {{ zone.name }} {{ fw4.nfproto(rule.family, true) }} {{
                        (target == "helper") ? "CT helper assignment" : "CT bypass"
                }}"
@@ -296,7 +296,7 @@ table inet fw4 {
 {%     if (devices_pos || subnets_pos): %}
                {%+ if (rule.family): -%}
                        meta nfproto {{ fw4.nfproto(rule.family) }} {%+ endif -%}
-               {%+ include("zone-match.uc", { fw4, rule: { ...rule, devices_pos, subnets_pos } }) -%}
+               {%+ include("zone-match.uc", { fw4, egress: false, rule: { ...rule, devices_pos, subnets_pos } }) -%}
                jump {{ target }}_{{ zone.name }} comment "!fw4: {{ zone.name }} {{ fw4.nfproto(rule.family, true) }} {{
                        (target == "helper") ? "CT helper assignment" : "CT bypass"
                }}"