]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
AddressAndPortRange: Make it clearer only low-order bits matter to us 14393/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 27 Jun 2024 14:27:54 +0000 (16:27 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 27 Jun 2024 14:27:54 +0000 (16:27 +0200)
Hopefully Coverity will take the hint.

pdns/iputils.hh

index ba9c50d7817ec0f2379e45d7f8441f406433f951..714bbe5ac89df08a82df9299d08b5fcef88ad0a9 100644 (file)
@@ -1708,7 +1708,7 @@ public:
 
     uint16_t port = d_addr.getPort();
     if (d_portMask < 16) {
-      uint16_t mask = ~(0xFFFF >> d_portMask);
+      auto mask = static_cast<uint16_t>(~(0xFFFF >> d_portMask));
       port = port & mask;
     }