From: Bert Hubert Date: Tue, 18 Nov 2008 12:58:43 +0000 (+0000) Subject: fix up the URL fancy record type, plus tell sdig no longer to emit EDNS0 by default X-Git-Tag: rec-3.2~223 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5e61f18cbe1329ade613fa48d438b7915d92c78a;p=pdns fix up the URL fancy record type, plus tell sdig no longer to emit EDNS0 by default git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@1299 d19b8d6e-7fed-0310-83ef-9ca221ded41b --- diff --git a/pdns/packethandler.cc b/pdns/packethandler.cc index 0ba74cba5..ae13a68f8 100644 --- a/pdns/packethandler.cc +++ b/pdns/packethandler.cc @@ -180,13 +180,11 @@ int PacketHandler::findUrl(DNSPacket *p, DNSPacket *r, string &target) int PacketHandler::doFancyRecords(DNSPacket *p, DNSPacket *r, string &target) { DNSResourceRecord rr; - if(p->qtype.getCode()==QType::MX) // check if this domain has smtp service from us return findMboxFW(p,r,target); if(p->qtype.getCode()==QType::A) // search for a URL record for an A return findUrl(p,r,target); - return 0; } @@ -660,6 +658,16 @@ DNSPacket *PacketHandler::questionOrRecurse(DNSPacket *p, bool *shouldRecurse) if(mret==2) { // there is some data, but not of the correct type r->clearRecords(); + + if(d_doFancyRecords) { // MBOXFW, URL <- fake records, emulated with MX and A + DLOG(L<<"There is some data, but not of the correct type, checking fancy records"<setRcode(RCode::ServFail); + goto sendit; + } + } DLOG(L<<"There is some data, but not of the correct type, adding SOA for NXRECORDSET"<setRcode(RCode::ServFail); - goto sendit; - } - } // now ready to start the real direct search diff --git a/pdns/sdig.cc b/pdns/sdig.cc index c5fbba278..2400e95ba 100644 --- a/pdns/sdig.cc +++ b/pdns/sdig.cc @@ -31,16 +31,15 @@ try NSRecordContent nrc2("ns2.powerdns.com"); nrc2.toPacket(pw); */ - + /* DNSPacketWriter::optvect_t opts; string ping("hallo!"); // opts.push_back(make_pair(5, ping)); pw.addOpt(5200, 0, 0x8000, opts); pw.commit(); - + */ Socket sock(InterNetwork, Datagram); IPEndpoint dest(argv[1] + (*argv[1]=='@'), atoi(argv[2])); - sock.sendTo(string((char*)&*packet.begin(), (char*)&*packet.end()), dest); string reply; @@ -55,7 +54,7 @@ try cout<first.d_place-1<<"\t"<first.d_label<<"\tIN\t"<first.d_type); cout<<"\t"<first.d_ttl<<"\t"<< i->first.d_content->getZoneRepresentation()<<"\n"; } - +#if 0 EDNSOpts edo; if(getEDNSOpts(mdp, &edo)) { @@ -71,6 +70,7 @@ try } } +#endif } catch(std::exception &e) {