]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
manager datamodel template: fix ttl in /local-data/{records,rpz}
authorVladimír Čunát <vladimir.cunat@nic.cz>
Tue, 8 Aug 2023 08:19:23 +0000 (10:19 +0200)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Tue, 8 Aug 2023 08:21:16 +0000 (10:21 +0200)
Record TTL is always meant in seconds by default.
More precise resolution does not exist.

manager/knot_resolver_manager/datamodel/templates/macros/local_data_macros.lua.j2

index 71db5d4fc3ab47c319a12e1ddb2cb19fbc171ab9..283c0f248faaaa42cacb9810ba4ec4c8306fdad5 100644 (file)
@@ -37,7 +37,7 @@ assert(hints.add_hosts('{{ file }}').result == true)
 {% macro local_data_records(input_str, is_rpz, ttl, nodata, tags=none, id='rrs') -%}
 {{ id }} = ffi.new('struct kr_rule_zonefile_config')
 {% if ttl %}
-{{ id }}.ttl = {{ ttl.millis() }}
+{{ id }}.ttl = {{ ttl.seconds() }}
 {% endif %}
 {% if tags %}
 {{ id }}.tags = {{ policy_get_tagset(tags) }}