ruleset: properly render redirect targets without port
authorJo-Philipp Wich <jo@mein.io>
Thu, 27 Jan 2022 12:43:36 +0000 (13:43 +0100)
committerJo-Philipp Wich <jo@mein.io>
Thu, 27 Jan 2022 12:46:51 +0000 (13:46 +0100)
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
root/usr/share/firewall4/templates/redirect.uc

index b710a044b79e015484fa0defeb26d2657bd89207..592af0f7949b4ca0ab2586cb936d80212cc8d543 100644 (file)
@@ -58,7 +58,7 @@
 {%+ if (redirect.counter): -%}
        counter {%+ endif -%}
 {% if (redirect.target == "redirect"): -%}
-       redirect to {{ fw4.port(redirect.rport) }}
+       redirect{% if (redirect.rport): %} to {{ fw4.port(redirect.rport) }}{% endif %}
 {%- elif (redirect.target == "accept" || redirect.target == "masquerade"): -%}
        {{ redirect.target }}
 {%- else -%}