Changeset 1239

Show
Ignore:
Timestamp:
07/25/08 20:43:39 (6 years ago)
Author:
ahu
Message:

prevent powerdns being hammered by servers repeating malformed queries ad nauseam

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/pdns/pdns/packethandler.cc

    r1232 r1239  
    604604    if(!validDNSName(p->qdomain)) { 
    605605      if(::arg().mustDo("log-dns-details")) 
    606         L<<Logger::Error<<"Received a malformed qdomain from "<<p->getRemote()<<", '"<<p->qdomain<<"': dropping"<<endl; 
     606        L<<Logger::Error<<"Received a malformed qdomain from "<<p->getRemote()<<", '"<<p->qdomain<<"': sending servfail"<<endl; 
    607607      S.inc("corrupt-packets"); 
    608       return 0; 
     608      r=p->replyPacket();  
     609      r->setRcode(RCode::ServFail); 
     610      return r; 
    609611    } 
    610612    if(p->d.opcode) { // non-zero opcode (again thanks RA!)