From: Peter van Dijk Date: Thu, 15 Mar 2018 14:06:07 +0000 (+0100) Subject: write bestwho in non-ECS case as well X-Git-Tag: dnsdist-1.3.1~136^2~26 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5a6d5b0847fafb9edc2401f714315b23b67dc9d7;p=pdns write bestwho in non-ECS case as well --- diff --git a/pdns/lua-record.cc b/pdns/lua-record.cc index fac8ac201..28845a9ec 100644 --- a/pdns/lua-record.cc +++ b/pdns/lua-record.cc @@ -426,12 +426,13 @@ std::vector> luaSynth(const std::string& code, cons if(dnsp.hasEDNSSubnet()) { lua.writeVariable("ecswho", dnsp.getRealRemote()); bestwho=dnsp.getRealRemote().getNetwork(); - lua.writeVariable("bestwho", dnsp.getRealRemote().getNetwork()); } else { bestwho=dnsp.getRemote(); } + lua.writeVariable("bestwho", bestwho); + lua.writeFunction("latlon", [&bestwho]() { double lat, lon; getLatLon(bestwho.toString(), lat, lon);