]> granicus.if.org Git - pdns/commitdiff
report remote IP when SOA query comes back with empty question section
authorPeter van Dijk <peter.van.dijk@powerdns.com>
Mon, 20 Nov 2017 13:32:23 +0000 (14:32 +0100)
committerPeter van Dijk <peter.van.dijk@powerdns.com>
Mon, 20 Nov 2017 13:32:23 +0000 (14:32 +0100)
this improves the #5974 situation a bit

pdns/resolver.cc

index 86b224543cea73b87e5dd34e8b3aca8d14e333bd..51d81160c49af4e11556fa30784d8833b97ee9cc 100644 (file)
@@ -258,6 +258,9 @@ bool Resolver::tryGetSOASerial(DNSName *domain, uint32_t *theirSerial, uint32_t
   *id=mdp.d_header.id;
   *domain = mdp.d_qname;
   
+  if(domain->empty())
+    throw ResolverException("SOA query to '" + fromaddr.toStringWithPort() + "' produced response without domain name (RCode: " + RCode::to_s(mdp.d_header.rcode) + ")");
+
   if(mdp.d_answers.empty())
     throw ResolverException("Query to '" + fromaddr.toStringWithPort() + "' for SOA of '" + domain->toString() + "' produced no results (RCode: " + RCode::to_s(mdp.d_header.rcode) + ")");