From: bert hubert Date: Wed, 24 Feb 2016 11:41:08 +0000 (+0100) Subject: because unset/empty netmasks did not compare as equal, we would fill the cache with... X-Git-Tag: auth-4.0.0-alpha2~6^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f563fff41eb03e7b936d8fb5f53c49f9b21ac17d;p=thirdparty%2Fpdns.git because unset/empty netmasks did not compare as equal, we would fill the cache with tens of thousands of duplicate entries per name --- diff --git a/pdns/iputils.hh b/pdns/iputils.hh index abdc4e96f0..3e89cb2ab0 100644 --- a/pdns/iputils.hh +++ b/pdns/iputils.hh @@ -95,6 +95,9 @@ union ComboAddress { bool operator<(const ComboAddress& rhs) const { + if(sin4.sin_family == 0) { + return false; + } if(boost::tie(sin4.sin_family, sin4.sin_port) < boost::tie(rhs.sin4.sin_family, rhs.sin4.sin_port)) return true; if(boost::tie(sin4.sin_family, sin4.sin_port) > boost::tie(rhs.sin4.sin_family, rhs.sin4.sin_port)) @@ -293,6 +296,7 @@ public: Netmask() { d_network.sin4.sin_family=0; // disable this doing anything useful + d_network.sin4.sin_port = 0; // this guarantees d_network compares identical d_mask=0; d_bits=0; }