From: Remi Gacogne Date: Wed, 4 Dec 2024 14:40:16 +0000 (+0100) Subject: dnsdist: Allow resetting `setConsistentHashingBalancingFactor()` to zero X-Git-Tag: dnsdist-1.9.8~3^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6f61a11a7127edd95b9f42684701c951582050b3;p=thirdparty%2Fpdns.git dnsdist: Allow resetting `setConsistentHashingBalancingFactor()` to zero --- diff --git a/pdns/dnsdist-lua.cc b/pdns/dnsdist-lua.cc index 87bd853b4f..a3840dea4a 100644 --- a/pdns/dnsdist-lua.cc +++ b/pdns/dnsdist-lua.cc @@ -2126,7 +2126,7 @@ static void setupLuaConfig(LuaContext& luaCtx, bool client, bool configCheck) luaCtx.writeFunction("setConsistentHashingBalancingFactor", [](double factor) { setLuaSideEffect(); - if (factor >= 1.0) { + if (factor >= 1.0 || factor == 0) { g_consistentHashBalancingFactor = factor; } else {