Skip to content

Instantly share code, notes, and snippets.

@Habbie
Created April 26, 2013 11:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Habbie/5466786 to your computer and use it in GitHub Desktop.
Save Habbie/5466786 to your computer and use it in GitHub Desktop.
diff -ur pdns-3.1.20120804.2690.org/pdns/packethandler.cc pdns-3.1.20120804.2690.new/pdns/packethandler.cc
--- pdns-3.1.20120804.2690.org/pdns/packethandler.cc 2012-08-04 22:19:20.000000000 +0200
+++ pdns-3.1.20120804.2690.new/pdns/packethandler.cc 2012-08-18 20:32:53.377479487 +0200
@@ -457,14 +457,17 @@
DNSResourceRecord rr;
rr.ttl = sd.default_ttl;
- B.lookup(QType(QType::ANY), unhashed);
- while(B.get(rr)) {
- n3rc.d_set.insert(rr.qtype.getCode());
- }
- if(unhashed == sd.qname) {
- n3rc.d_set.insert(QType::NSEC3PARAM);
- n3rc.d_set.insert(QType::DNSKEY);
+ if(!unhashed.empty()) {
+ B.lookup(QType(QType::ANY), unhashed);
+ while(B.get(rr)) {
+ n3rc.d_set.insert(rr.qtype.getCode());
+ }
+
+ if(unhashed == sd.qname) {
+ n3rc.d_set.insert(QType::NSEC3PARAM);
+ n3rc.d_set.insert(QType::DNSKEY);
+ }
}
n3rc.d_nexthash=end;
@@ -545,8 +548,10 @@
if(narrow) { // nsec3-narrow
ret=true;
before=hashed;
- if(decrement)
+ if(decrement) {
decrementHash(before);
+ unhashed.clear();
+ }
after=hashed;
incrementHash(after);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment