From: Y7n05h Date: Thu, 14 Apr 2022 09:57:29 +0000 (+0800) Subject: Update pdns/dnsdist-lua-bindings.cc X-Git-Tag: auth-4.8.0-alpha0~137^2~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=72a0f73424b1b851bac714978374d91304eb437b;p=thirdparty%2Fpdns.git Update pdns/dnsdist-lua-bindings.cc Co-authored-by: Remi Gacogne --- diff --git a/pdns/dnsdist-lua-bindings.cc b/pdns/dnsdist-lua-bindings.cc index 877a6f3fe4..7b5c837d6c 100644 --- a/pdns/dnsdist-lua-bindings.cc +++ b/pdns/dnsdist-lua-bindings.cc @@ -433,11 +433,13 @@ void setupLuaBindings(LuaContext& luaCtx, bool client) std::unordered_map mapsConfig; const auto convertParamsToConfig = [&](const std::string name, BPFFilter::MapType type) { - if (!opts.count(name)) + if (!opts.count(name)) { return; + } const auto& tmp = opts.at(name); - if (tmp.type() != typeid(bpfFilterMapParams)) + if (tmp.type() != typeid(bpfFilterMapParams)) { throw std::runtime_error("params is invalid"); + } const auto& params = boost::get(tmp); BPFFilter::MapConfiguration config; config.d_type = type; @@ -464,10 +466,12 @@ void setupLuaBindings(LuaContext& luaCtx, bool client) bool external = false; if (opts.count("external")) { const auto& tmp = opts.at("external"); - if (tmp.type() != typeid(bool)) + if (tmp.type() != typeid(bool)) { throw std::runtime_error("params is invalid"); - if ((external = boost::get(tmp))) + } + if ((external = boost::get(tmp))) { format = BPFFilter::MapFormat::WithActions; + } } return std::make_shared(mapsConfig, format, external);