]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
because unset/empty netmasks did not compare as equal, we would fill the cache with...
authorbert hubert <bert.hubert@netherlabs.nl>
Wed, 24 Feb 2016 11:41:08 +0000 (12:41 +0100)
committerbert hubert <bert.hubert@powerdns.com>
Wed, 24 Feb 2016 13:35:54 +0000 (14:35 +0100)
pdns/iputils.hh

index abdc4e96f0afc1a6325bb6a3e5b33a88bb4b8828..3e89cb2ab00ab5dd248aa35f2fe52e228efda57a 100644 (file)
@@ -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;
   }