]> granicus.if.org Git - pdns/commitdiff
rec: Dump RRSIGs from record cache
authorPieter Lexis <pieter.lexis@powerdns.com>
Mon, 10 Jul 2017 11:29:49 +0000 (13:29 +0200)
committerPieter Lexis <pieter.lexis@powerdns.com>
Mon, 10 Jul 2017 11:54:33 +0000 (13:54 +0200)
pdns/recursor_cache.cc

index e78c986394e51affd40ab21e63ea2f1d22998e17..0146bd111d7a08060f2e6699d018e4eee277e937 100644 (file)
@@ -456,6 +456,15 @@ uint64_t MemRecursorCache::doDump(int fd)
         fprintf(fp, "; error printing '%s'\n", i.d_qname.empty() ? "EMPTY" : i.d_qname.toString().c_str());
       }
     }
+    for(const auto &sig : i.d_signatures) {
+      count++;
+      try {
+        fprintf(fp, "%s %" PRId64 " IN RRSIG %s ; %s\n", i.d_qname.toString().c_str(), static_cast<int64_t>(i.d_ttd - now), sig->getZoneRepresentation().c_str(), i.d_netmask.empty() ? "" : i.d_netmask.toString().c_str());
+      }
+      catch(...) {
+        fprintf(fp, "; error printing '%s'\n", i.d_qname.empty() ? "EMPTY" : i.d_qname.toString().c_str());
+      }
+    }
   }
   fclose(fp);
   return count;