]> granicus.if.org Git - pdns/commitdiff
dnsdist: Only copy the DNSName, not the whole ring entry
authorRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 29 Mar 2018 09:37:27 +0000 (11:37 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 29 Mar 2018 09:37:52 +0000 (11:37 +0200)
pdns/dnsdist-lua-inspection.cc

index f8829d88f5a6aa7869222cd6d9501afe5de9e6d1..0c28d1e5a5a03f516c8224fe584d8a528c7f9c34 100644 (file)
@@ -44,12 +44,13 @@ static std::unordered_map<unsigned int, vector<boost::variant<string,double>>> g
       }
       else {
         unsigned int lab = *labels;
-        for(auto a : shard->respRing) {
+        for(const auto& a : shard->respRing) {
           if(!pred(a))
             continue;
 
-          a.name.trimToLabels(lab);
-          counts[a.name]++;
+          DNSName temp(a.name);
+          temp.trimToLabels(lab);
+          counts[temp]++;
           total++;
         }
       }