From: Remi Gacogne Date: Thu, 27 Jun 2024 14:27:54 +0000 (+0200) Subject: AddressAndPortRange: Make it clearer only low-order bits matter to us X-Git-Tag: rec-5.2.0-alpha1~212^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F14393%2Fhead;p=thirdparty%2Fpdns.git AddressAndPortRange: Make it clearer only low-order bits matter to us Hopefully Coverity will take the hint. --- diff --git a/pdns/iputils.hh b/pdns/iputils.hh index ba9c50d781..714bbe5ac8 100644 --- a/pdns/iputils.hh +++ b/pdns/iputils.hh @@ -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(~(0xFFFF >> d_portMask)); port = port & mask; }