From: Remi Gacogne Date: Tue, 18 Nov 2025 08:50:35 +0000 (+0100) Subject: dnsdist: Change bogusV4/bogusV6 addresses to static constants to avoid parse in every... X-Git-Tag: rec-5.4.0-alpha1~65^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2f8a489af473178a6570ce1720c65712ce34d763;p=thirdparty%2Fpdns.git 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 --- 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; }