From 2f8a489af473178a6570ce1720c65712ce34d763 Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Tue, 18 Nov 2025 09:50:35 +0100 Subject: [PATCH] dnsdist: Change bogusV4/bogusV6 addresses to static constants to avoid parse in every call Based on a patch by @delichick (thanks!). Signed-off-by: Remi Gacogne --- pdns/dnsdistdist/dnsdist.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pdns/dnsdistdist/dnsdist.cc b/pdns/dnsdistdist/dnsdist.cc index 3a24f0cb78..eec766b434 100644 --- a/pdns/dnsdistdist/dnsdist.cc +++ b/pdns/dnsdistdist/dnsdist.cc @@ -1298,8 +1298,8 @@ static bool isUDPQueryAcceptable(ClientState& clientState, const struct msghdr* This is indicated by setting the family to 0 which is acted upon in sendUDPResponse() and DelayedPacket::(). */ - const ComboAddress bogusV4("0.0.0.0:0"); - const ComboAddress bogusV6("[::]:0"); + static const ComboAddress bogusV4("0.0.0.0:0"); + static const ComboAddress bogusV6("[::]:0"); if ((dest.sin4.sin_family == AF_INET && dest == bogusV4) || (dest.sin4.sin_family == AF_INET6 && dest == bogusV6)) { dest.sin4.sin_family = 0; } -- 2.47.3