diff options
author | Vladimír Čunát <vladimir.cunat@nic.cz> | 2020-06-30 15:45:08 +0200 |
---|---|---|
committer | Vladimír Čunát <vladimir.cunat@nic.cz> | 2020-06-30 18:28:15 +0200 |
commit | 7e472204a2286c6b57648d6d8df5731d29d8c940 (patch) | |
tree | 52b85c36cb657762e0bcbb7b06adbab941bfa0dd /modules/policy/policy.lua | |
parent | policy.rpz: fix $ORIGIN-related handling (diff) | |
download | knot-resolver-7e472204a2286c6b57648d6d8df5731d29d8c940.tar.xz knot-resolver-7e472204a2286c6b57648d6d8df5731d29d8c940.zip |
policy.ANSWER: allow multiple RRs
... by allowing .rdata to be a table. Larger RRsets seem useful.
Diffstat (limited to '')
-rw-r--r-- | modules/policy/policy.lua | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/modules/policy/policy.lua b/modules/policy/policy.lua index 1bb528d5..e839f1ab 100644 --- a/modules/policy/policy.lua +++ b/modules/policy/policy.lua @@ -228,7 +228,13 @@ function policy.ANSWER(rtable, nodata) answer:rcode(kres.rcode.NOERROR) answer:begin(kres.section.ANSWER) - answer:put(qry.sname, ttl, qry.sclass, qry.stype, data.rdata) + if type(data.rdata) == 'table' then + for _, rdato in ipairs(data.rdata) do + answer:put(qry.sname, ttl, qry.sclass, qry.stype, rdato) + end + else + answer:put(qry.sname, ttl, qry.sclass, qry.stype, data.rdata) + end return kres.DONE end |