diff options
author | Christian Poessinger <christian@poessinger.com> | 2022-01-20 20:22:18 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-20 20:22:18 +0100 |
commit | fcb1b6c69ffc644769006ee605812461dcb1d048 (patch) | |
tree | 0b40c38c2f6b343349e2db8664d9f0b01ace5a13 /data/templates/firewall/nftables.tmpl | |
parent | 876d108c5dbab98f9d7a38c05abe098c0ca2d919 (diff) | |
parent | d1d0150b6a40252700181530ca87c5699a4bd0b4 (diff) | |
download | vyos-1x-fcb1b6c69ffc644769006ee605812461dcb1d048.tar.gz vyos-1x-fcb1b6c69ffc644769006ee605812461dcb1d048.zip |
Merge pull request #1181 from sarthurdev/firewall
firewall: T2199: Add log prefix to match legacy perl behaviour
Diffstat (limited to 'data/templates/firewall/nftables.tmpl')
-rw-r--r-- | data/templates/firewall/nftables.tmpl | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/data/templates/firewall/nftables.tmpl b/data/templates/firewall/nftables.tmpl index 81b2c0b98..33c821e84 100644 --- a/data/templates/firewall/nftables.tmpl +++ b/data/templates/firewall/nftables.tmpl @@ -32,18 +32,13 @@ table ip filter { {% endif %} {% if name is defined %} {% for name_text, conf in name.items() %} -{% set default_log = 'log' if 'enable_default_log' in conf else '' %} chain {{ name_text }} { {% if conf.rule is defined %} {% for rule_id, rule_conf in conf.rule.items() if rule_conf.disable is not defined %} {{ rule_conf | nft_rule(name_text, rule_id) }} {% endfor %} {% endif %} -{% if conf.default_action is defined %} - counter {{ default_log }} {{ conf.default_action | nft_action }} comment "{{ name_text }} default-action {{ conf.default_action }}" -{% else %} - return -{% endif %} + {{ conf | nft_default_rule(name_text) }} } {% endfor %} {% endif %} @@ -87,18 +82,13 @@ table ip6 filter { {% endif %} {% if ipv6_name is defined %} {% for name_text, conf in ipv6_name.items() %} -{% set default_log = 'log' if 'enable_default_log' in conf else '' %} chain {{ name_text }} { {% if conf.rule is defined %} {% for rule_id, rule_conf in conf.rule.items() if rule_conf.disable is not defined %} {{ rule_conf | nft_rule(name_text, rule_id, 'ip6') }} {% endfor %} {% endif %} -{% if conf.default_action is defined %} - counter {{ default_log }} {{ conf.default_action | nft_action }} comment "{{ name_text }} default-action {{ conf.default_action }}" -{% else %} - return -{% endif %} + {{ conf | nft_default_rule(name_text) }} } {% endfor %} {% endif %} |