memcpy(buffer,&d,sizeof(d)); // commit spoofed id
sendto(i->second.outsock,buffer,len,0,(struct sockaddr*)&i->second.remote,i->second.addrlen);
-
+
DNSPacket p,q;
p.parse(buffer,len);
q.parse(buffer,len);
-
+
PC.insert(&q, &p);
i->second.created=0;
}
/*
PowerDNS Versatile Database Driven Nameserver
- Copyright (C) 2002 PowerDNS.COM BV
+ Copyright (C) 2005 PowerDNS.COM BV
This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
+ it under the terms of the GNU General Public License version 2 as
+ published by the Free Software Foundation
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "utility.hh"\r
+#include "utility.hh"
#include "packetcache.hh"
#include "logger.hh"
#include "arguments.hh"
DNSResourceRecord rr;
if (p->qclass == 3 && p->qtype.getName() == "HINFO") {
- rr.content = "PowerDNS $Id: packethandler.cc,v 1.27 2005/01/11 19:41:11 ahu Exp $";
+ rr.content = "PowerDNS $Id$";
rr.ttl = 5;
rr.qname=target;
rr.qtype=13; // hinfo
const string mode=arg()["version-string"];
if(p->qtype.getCode()==QType::TXT && target=="version.bind") {// TXT
if(mode.empty() || mode=="full")
- rr.content="Served by POWERDNS "VERSION" $Id: packethandler.cc,v 1.27 2005/01/11 19:41:11 ahu Exp $";
+ rr.content="Served by POWERDNS "VERSION" $Id$";
else if(mode=="anonymous") {
r->setRcode(RCode::ServFail);
return 1;
bool found=false;
string target=p->qdomain;
-
+ bool noCache=false;
+
if (doDNSCheckRequest(p, r, target))
goto sendit;
else
weAuth=false;
- if(p->d.rd && d_doRecursion && !weAuth && DP->sendPacket(p)) {
- delete r;
- return 0;
- }
+ if(p->d.rd && d_doRecursion && !weAuth) {
+ if(DP->sendPacket(p)) {
+ delete r;
+ return 0;
+ }
+ else noCache=true;
+ }
+
string::size_type pos;
DLOG(L<<"Nothing found so far for '"<<target<<"', do we even have authority over this domain?"<<endl);
// whatever we've built so far, do additional processing
sendit:;
-
if(doAdditionalProcessingAndDropAA(p,r)<0)
return 0;
-
-
-
-
r->wrapup(); // needed for inserting in cache
- PC.insert(p,r); // in the packet cache
+ if(!noCache)
+ PC.insert(p,r); // in the packet cache
}
catch(DBException &e) {
L<<Logger::Error<<"Database module reported condition which prevented lookup - sending out servfail"<<endl;