From e9a5bdb12befd37c611e6223e6afc33570dfea3c Mon Sep 17 00:00:00 2001 From: Stephan Bosch Date: Wed, 9 Oct 2019 02:34:15 +0200 Subject: [PATCH] iputils.hh: Netmask: Add getNormalized() --- pdns/iputils.hh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pdns/iputils.hh b/pdns/iputils.hh index 9bfb317dfe..09134e2ad4 100644 --- a/pdns/iputils.hh +++ b/pdns/iputils.hh @@ -537,6 +537,10 @@ public: return d_network.sin4.sin_family==0; } + //! Get normalized version of the netmask. This means that all address bits below the network bits are zero. + Netmask getNormalized() const { + return Netmask(getMaskedNetwork(), d_bits); + } private: ComboAddress d_network; uint32_t d_mask; -- 2.47.3