From: Remi Gacogne Date: Fri, 8 Dec 2023 15:59:30 +0000 (+0100) Subject: dnsdist: Apply Otto's suggestion for the qtypeForAny parameter X-Git-Tag: dnsdist-1.9.0-alpha4~9^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F13560%2Fhead;p=thirdparty%2Fpdns.git dnsdist: Apply Otto's suggestion for the qtypeForAny parameter --- diff --git a/pdns/dnsdist-lua-actions.cc b/pdns/dnsdist-lua-actions.cc index 66c2889bcf..5aa994a1a6 100644 --- a/pdns/dnsdist-lua-actions.cc +++ b/pdns/dnsdist-lua-actions.cc @@ -2510,7 +2510,11 @@ void setupLuaActions(LuaContext& luaCtx) if (qtypeForAny > std::numeric_limits::max()) { qtypeForAny = 0; } - auto ret = std::shared_ptr(new SpoofAction(raws, qtypeForAny > 0 ? static_cast(qtypeForAny) : std::optional())); + std::optional qtypeForAnyParam; + if (qtypeForAny > 0) { + qtypeForAnyParam = static_cast(qtypeForAny); + } + auto ret = std::shared_ptr(new SpoofAction(raws, qtypeForAnyParam)); auto sa = std::dynamic_pointer_cast(ret); parseResponseConfig(vars, sa->d_responseConfig); checkAllParametersConsumed("SpoofRawAction", vars);