]> granicus.if.org Git - pdns/commitdiff
also check class in dnspacketlessthan
authorBert Hubert <bert.hubert@netherlabs.nl>
Wed, 11 Aug 2010 08:52:03 +0000 (08:52 +0000)
committerBert Hubert <bert.hubert@netherlabs.nl>
Wed, 11 Aug 2010 08:52:03 +0000 (08:52 +0000)
git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@1688 d19b8d6e-7fed-0310-83ef-9ca221ded41b

pdns/dns.cc

index d90bed20afb65c876ffb00d24c6fd244a4785148..c0a47739e969907cefc9215de73907ca877a99ee 100644 (file)
@@ -84,7 +84,11 @@ bool dnspacketLessThan(const std::string& a, const std::string& b)
       
   uint16_t aQtype = aSafe[aPos]*256 + aSafe[aPos + 1];
   uint16_t bQtype = bSafe[bPos]*256 + bSafe[bPos + 1];
-  return aQtype < bQtype;
+  
+  uint16_t aQclass = aSafe[aPos+2]*256 + aSafe[aPos + 3];
+  uint16_t bQclass = bSafe[bPos+2]*256 + bSafe[bPos + 3];
+  
+  return boost::tie(aQtype, aQclass) < boost::tie(bQtype, bQclass);
 }