From 1c5675158d441ac95a823bce5b645a2fd5e8b14a Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Fri, 6 Jan 2017 11:38:27 +0100 Subject: [PATCH] rec: Fix `dq` members alterations from Lua not being taken into account Apparently when using reference, LuaWrapper pass the object by copy and not by reference, so for now we pass `dq` as a pointer, not a reference. --- pdns/lua-recursor4.cc | 4 ++-- pdns/lua-recursor4.hh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pdns/lua-recursor4.cc b/pdns/lua-recursor4.cc index ba7c1063d2..13b5a7f703 100644 --- a/pdns/lua-recursor4.cc +++ b/pdns/lua-recursor4.cc @@ -665,7 +665,7 @@ bool RecursorLua4::genhook(luacall_t& func, DNSQuestion& dq, int& ret) dq.udpCallback.clear(); dq.rcode = ret; - bool handled=func(dq); + bool handled=func(&dq); if(handled) { loop:; @@ -688,7 +688,7 @@ loop:; theL()< luacall_t; + typedef std::function luacall_t; luacall_t d_prerpz, d_preresolve, d_nxdomain, d_nodata, d_postresolve, d_preoutquery, d_postoutquery; bool genhook(luacall_t& func, DNSQuestion& dq, int& ret); typedef std::function ipfilter_t; -- 2.47.2