Created
October 13, 2015 17:05
-
-
Save vavrusa/41046bdc8396fc53dbe3 to your computer and use it in GitHub Desktop.
Small module that appends SOA for NS queries.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local mod = {} | |
mod.layer = { | |
consume = function (state, req, answer) | |
if state == kres.FAIL then | |
return state | |
end | |
answer = kres.pkt_t(answer) | |
req = kres.request_t(req) | |
if answer:qtype() == kres.type.NS then | |
local qry = req:push(answer:qname(), kres.type.SOA, kres.class.IN) | |
qry.flags = kres.query.AWAIT_CUT | |
end | |
return state | |
end | |
} | |
return mod |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment