From f563fff41eb03e7b936d8fb5f53c49f9b21ac17d Mon Sep 17 00:00:00 2001 From: bert hubert Date: Wed, 24 Feb 2016 12:41:08 +0100 Subject: [PATCH] because unset/empty netmasks did not compare as equal, we would fill the cache with tens of thousands of duplicate entries per name --- pdns/iputils.hh | 4 ++++ 1 file changed, 4 insertions(+) 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; } -- 2.47.2