summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-06-26 16:56:12 +0200
committerChristian Poessinger <christian@poessinger.com>2021-06-26 16:56:12 +0200
commitf98bad44fc9cd152955ef9e2bc54e811b8dd6cf5 (patch)
treef980413393162da8ce3ca4bc0bc4ebaed732caa7
parent166d44b32813c9dd64c3857beaf5eac8382b2d6d (diff)
downloadvyos-1x-f98bad44fc9cd152955ef9e2bc54e811b8dd6cf5.tar.gz
vyos-1x-f98bad44fc9cd152955ef9e2bc54e811b8dd6cf5.zip
nat: T1083: fix Jinja2 templating error
Commit 166d44b3 ("nat: T1083: add translation options for persistent/random mapping of address and port") added support for persistent IP address and port mappings for NAT. Unfortunately one if clause got lost in translation.
-rw-r--r--data/templates/firewall/nftables-nat.tmpl4
1 files changed, 2 insertions, 2 deletions
diff --git a/data/templates/firewall/nftables-nat.tmpl b/data/templates/firewall/nftables-nat.tmpl
index e2776e9c2..40ed1b916 100644
--- a/data/templates/firewall/nftables-nat.tmpl
+++ b/data/templates/firewall/nftables-nat.tmpl
@@ -73,8 +73,8 @@
{% set trns_addr = 'return' %}
{% set trns_port = '' %}
{% endif %}
-{# T1083: NAT address and port translation options #}
-{% if config.translation.options is defined and config.translation.options is not none %}
+{# T1083: NAT address and port translation options #}
+{% if config.translation is defined and config.translation.options is defined and config.translation.options is not none %}
{% if config.translation.options.address_mapping is defined and config.translation.options.address_mapping == "persistent" %}
{% set trns_opts_addr = 'persistent' %}
{% endif %}