From: bert hubert Date: Thu, 22 Feb 2018 23:56:32 +0000 (+0100) Subject: make Lua getID() return a number in the right byte order X-Git-Tag: dnsdist-1.3.1~136^2~28 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7a95b8647fd7fab14a7aa27889be6406a6f0d7fa;p=pdns make Lua getID() return a number in the right byte order --- 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; });