]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Experiment
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Thu, 8 Feb 2024 15:36:09 +0000 (16:36 +0100)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Thu, 8 Feb 2024 15:36:09 +0000 (16:36 +0100)
pdns/dnsdist-lua.cc

index 50112a3730b0f09d52cc19c7ab5258d80932105f..1094be77a5424bd5dfd0ab6577daac6975b1c920 100644 (file)
@@ -2230,6 +2230,11 @@ static void setupLuaConfig(LuaContext& luaCtx, bool client, bool configCheck)
     g_policy.setState(policy);
   });
 
+  luaCtx.writeFunction("setServerPolicy", [](const ServerPolicy* policy) {
+    setLuaSideEffect();
+    g_policy.setState(*policy);
+  });
+
   luaCtx.writeFunction("setServerPolicyLua", [](const string& name, ServerPolicy::policyfunc_t policy) {
     setLuaSideEffect();
     g_policy.setState(ServerPolicy{name, policy, true});