]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Change bogusV4/bogusV6 addresses to static constants to avoid parse in every... 16525/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 18 Nov 2025 08:50:35 +0000 (09:50 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 18 Nov 2025 08:50:35 +0000 (09:50 +0100)
Based on a patch by @delichick (thanks!).

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
pdns/dnsdistdist/dnsdist.cc

index 3a24f0cb78a07be2bd4e3683377872e6870f1dab..eec766b434a951f9fc0cbb8546eac584ead102b2 100644 (file)
@@ -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;
     }