From: Remi Gacogne Date: Thu, 10 Dec 2015 16:18:30 +0000 (+0100) Subject: Warn that addLocal() and setLocal() can't be used at runtime X-Git-Tag: dnsdist-1.0.0-alpha1~78^2~1^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F3017%2Fhead;p=thirdparty%2Fpdns.git Warn that addLocal() and setLocal() can't be used at runtime --- diff --git a/pdns/dnsdist-lua.cc b/pdns/dnsdist-lua.cc index 45a8d0c70b..e1cd5badf3 100644 --- a/pdns/dnsdist-lua.cc +++ b/pdns/dnsdist-lua.cc @@ -289,6 +289,10 @@ vector> setupLua(bool client, const std::string& confi g_lua.writeFunction("setLocal", [client](const std::string& addr, boost::optional doTCP) { if(client) return; + if (g_configurationDone) { + g_outputBuffer="setLocal cannot be used at runtime!\n"; + return; + } try { ComboAddress loc(addr, 53); g_locals.clear(); @@ -302,6 +306,10 @@ vector> setupLua(bool client, const std::string& confi g_lua.writeFunction("addLocal", [client](const std::string& addr, boost::optional doTCP) { if(client) return; + if (g_configurationDone) { + g_outputBuffer="addLocal cannot be used at runtime!\n"; + return; + } try { ComboAddress loc(addr, 53); g_locals.push_back({loc, doTCP ? *doTCP : true}); /// only works pre-startup, so no sync necessary