nftables: adapt to new j2 syntax

master
Y 2020-01-02 14:08:46 +01:00
parent 54398ce7e9
commit d31350f130
1 changed files with 2 additions and 1 deletions

View File

@ -4,13 +4,14 @@
# Full licensing information in the LICENSE file, or gnu.org/licences/gpl-3.0.txt if the file is missing.
flush ruleset
{% for V in ['4', '6'] %}
{% set v = V | replace('4', '') %}
{% macro trust(list) %}
{% for net in list.split(' ') %}
{% if not net is match('127(?:\.\d{1,3}){3}(?:/\d+)?|::1|^$') %}
{% if (net is match('\d{1,3}(?:\.\d{1,3}){3}(?:/\d+)?')
and V == '4') or (net | search(':') and V == '6') %}
and V == '4') or (net is search(':') and V == '6') %}
{{caller(net)}}
{% endif %}
{% endif %}