From: bert hubert Date: Sat, 21 Nov 2015 21:00:51 +0000 (+0100) Subject: make setACL() also accept a single netmask X-Git-Tag: dnsdist-1.0.0-alpha1~210^2~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e4944ea06267af20363a94f86747bfb55bdba556;p=thirdparty%2Fpdns.git make setACL() also accept a single netmask --- diff --git a/pdns/dnsdist-lua.cc b/pdns/dnsdist-lua.cc index 7db5a4582d..4ba8c1bd45 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 5e2137743f..13c908e8e2 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;