From 7a95b8647fd7fab14a7aa27889be6406a6f0d7fa Mon Sep 17 00:00:00 2001 From: bert hubert Date: Fri, 23 Feb 2018 00:56:32 +0100 Subject: [PATCH] make Lua getID() return a number in the right byte order --- pdns/lua-base4.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pdns/lua-base4.cc b/pdns/lua-base4.cc index eb37dd92a..b514597ab 100644 --- a/pdns/lua-base4.cc +++ b/pdns/lua-base4.cc @@ -43,7 +43,7 @@ void BaseLua4::prepareContext() { d_lw = std::unique_ptr(new LuaContext); // dnsheader - d_lw->registerFunction("getID", [](dnsheader& dh) { return dh.id; }); + d_lw->registerFunction("getID", [](dnsheader& dh) { return ntohs(dh.id); }); d_lw->registerFunction("getCD", [](dnsheader& dh) { return dh.cd; }); d_lw->registerFunction("getTC", [](dnsheader& dh) { return dh.tc; }); d_lw->registerFunction("getRA", [](dnsheader& dh) { return dh.ra; }); -- 2.40.0