fw4: add log_limit to rules and redirects
[project/firewall4.git] / root / usr / share / firewall4 / templates / redirect.uc
index c1310a71a33f3a3a8cc71550f822595cd551f1a7..f24872c01be498a24afad16a927f3b80cf031c7d 100644 (file)
        {{ fw4.concat(redirect.ipset.fields) }}{{
                redirect.ipset.invert ? ' !=' : ''
        }} @{{ redirect.ipset.name }} {%+ endif -%}
-{%+ if (redirect.log && zone?.log_limit): -%}
+{%+ if (redirect.log && redirect.log_limit): -%}
+       limit rate {{ redirect.log_limit.rate }}/{{ redirect.log_limit.unit }} log prefix {{ fw4.quote(redirect.log, true) }}
+               {%+ include("redirect.uc", { fw4, zone, redirect: { ...redirect, log: 0 } }) %}
+{%+ elif (redirect.log && zone?.log_limit): -%}
        limit name "{{ zone.name }}.log_limit" log prefix {{ fw4.quote(redirect.log, true) }}
                {%+ include("redirect.uc", { fw4, zone, redirect: { ...redirect, log: 0 } }) %}
 {%+ else -%}