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

Mar 2017
Marek VavruĊĦa
Mar 29 2017 02:21
plenty of ways, try something like local ip = req.qsource.addr:ip() print(string.format('%d.%d.%d.%d', ip[0], ip[1], ip[2], ip[3]))
the ljsyscall has nicer ways how to work with addresses, you can use ffi to inet_ntop, ...
you'll have to work with v6 addresses differently, check the address length by ip:len()