These are chat archives for CZ-NIC/knot-resolver

May 2017
Mike Emigh
May 30 2017 07:02
luajit 2.1-beta3 is supported, correct?
Mike Emigh
May 30 2017 07:13
include/luajit-2.1/lauxlib.h:88:18: note: previous declaration of 'luaL_setfuncs' was here
 LUALIB_API void (luaL_setfuncs) (lua_State *L, const luaL_Reg *l, int nup);
gmake: *** [daemon/ daemon/engine.o] Error 1
I have that problem with 2.1, but it looks like the docker image uses 2.1
Mike Emigh
May 30 2017 07:55
a ha, found the commit that fixes it in master
Vladimír Čunát
May 30 2017 08:01
Right :-)
Mike Emigh
May 30 2017 08:39
I've got this weird problem where I can add domains to the list of domains for views
but I've a load that table from a file, it panis
PANIC: unprotected error in call to Lua API (8)
local file = "/etc/kresd/"
local arr = {}
for line in io.lines(file) do
    --table.insert(arr, line)
    arr[#arr + 1] = line
local arr2 = {}
for i = 1, #arr do
    io.write(string.format("domain: %s", arr[i]))
arr2[1] = todname('blah\n')
arr2[2] = todname('my.test.')
local sdf = 'sdf'
table.insert(arr2, todname('my.test'))
table.insert(arr2, todname 'blah3')
table.insert(arr2, todname(sdf))
view:addr('', policy.suffix(policy.DENY, arr))
if I change that last line to arr2 instead of arr, it works fine
any idea why creating the table from the file causes a panic when adding to the view?
fails inside the aho-corasick module
Vladimír Čunát
May 30 2017 08:46
No immediate ideas. Sounds like some bug in that module.
Mike Emigh
May 30 2017 08:47
looks like they may have improved their implementation
not pure lua now
Mike Emigh
May 30 2017 09:05
I'm going to attempt to compile and use that, I'll let you know if it works
Vladimír Čunát
May 30 2017 09:06
Great. We can't give much time into it at this moment.
Mike Emigh
May 30 2017 10:05
newer module works with a small change to policy.suffix
function policy.suffix(action, zone_list)
        local AC = require('ahocorasick')
        local tree = AC.create(zone_list)

        return function(req, query)
                local match = AC.match(tree, query:name(), false)
                if match ~= nil then
                        return action
                return nil
working function
Vladimír Čunát
May 30 2017 10:14
And the update fixed that panic problem, right? (besides the expected performance gains)
Mike Emigh
May 30 2017 10:29