From: Remi Gacogne Date: Thu, 13 Feb 2025 10:48:23 +0000 (+0100) Subject: dnsdist: Fix console ("client mode") on non-default address or port X-Git-Tag: dnsdist-2.0.0-alpha1~98^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F15148%2Fhead;p=thirdparty%2Fpdns.git dnsdist: Fix console ("client mode") on non-default address or port The console address and port were not properly set in client mode, so `dnsdist` tried to connect to the default console address and port. --- diff --git a/pdns/dnsdistdist/dnsdist-lua.cc b/pdns/dnsdistdist/dnsdist-lua.cc index 464f019225..29e0d19491 100644 --- a/pdns/dnsdistdist/dnsdist-lua.cc +++ b/pdns/dnsdistdist/dnsdist-lua.cc @@ -1171,14 +1171,15 @@ static void setupLuaConfig(LuaContext& luaCtx, bool client, bool configCheck) setLuaSideEffect(); ComboAddress local(str, 5199); - if (client || configCheck) { - return; - } - dnsdist::configuration::updateRuntimeConfiguration([local](dnsdist::configuration::RuntimeConfiguration& config) { config.d_consoleServerAddress = local; config.d_consoleEnabled = true; }); + + if (client || configCheck) { + return; + } + #if defined(HAVE_LIBSODIUM) || defined(HAVE_LIBCRYPTO) if (dnsdist::configuration::isImmutableConfigurationDone() && dnsdist::configuration::getCurrentRuntimeConfiguration().d_consoleKey.empty()) { warnlog("Warning, the console has been enabled via 'controlSocket()' but no key has been set with 'setKey()' so all connections will fail until a key has been set");