From e4944ea06267af20363a94f86747bfb55bdba556 Mon Sep 17 00:00:00 2001 From: bert hubert Date: Sat, 21 Nov 2015 22:00:51 +0100 Subject: [PATCH] make setACL() also accept a single netmask --- pdns/dnsdist-lua.cc | 7 +++++-- pdns/dnsdist.cc | 1 - 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pdns/dnsdist-lua.cc b/pdns/dnsdist-lua.cc index 7db5a4582..4ba8c1bd4 100644 --- a/pdns/dnsdist-lua.cc +++ b/pdns/dnsdist-lua.cc @@ -292,9 +292,12 @@ vector> setupLua(bool client, const std::string& confi g_outputBuffer="Error: "+string(e.what())+"\n"; } }); - g_lua.writeFunction("setACL", [](const vector>& parts) { + g_lua.writeFunction("setACL", [](boost::variant>> inp) { NetmaskGroup nmg; - for(const auto& p : parts) { + if(auto str = boost::get(&inp)) { + nmg.addMask(*str); + } + else for(const auto& p : boost::get>>(inp)) { nmg.addMask(p.second); } g_ACL.setState(nmg); diff --git a/pdns/dnsdist.cc b/pdns/dnsdist.cc index 5e2137743..13c908e8e 100644 --- a/pdns/dnsdist.cc +++ b/pdns/dnsdist.cc @@ -412,7 +412,6 @@ try } auto acl = g_ACL.getLocal(); auto localPolicy = g_policy.getLocal(); - auto localRulactions = g_rulactions.getLocal(); auto localServers = g_dstates.getLocal(); struct msghdr msgh; -- 2.40.0