Changeset 1299

Show
Ignore:
Timestamp:
11/18/08 13:58:43 (16 months ago)
Author:
ahu
Message:

fix up the URL fancy record type, plus tell sdig no longer to emit EDNS0 by default

Location:
trunk/pdns/pdns
Files:
2 modified

Legend:

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

    r1289 r1299  
    181181{ 
    182182  DNSResourceRecord rr; 
    183  
    184183  if(p->qtype.getCode()==QType::MX)  // check if this domain has smtp service from us 
    185184    return findMboxFW(p,r,target); 
     
    187186  if(p->qtype.getCode()==QType::A)   // search for a URL record for an A 
    188187    return findUrl(p,r,target); 
    189  
    190188  return 0; 
    191189} 
     
    661659    if(mret==2) { // there is some data, but not of the correct type 
    662660      r->clearRecords(); 
     661 
     662      if(d_doFancyRecords) { // MBOXFW, URL <- fake records, emulated with MX and A 
     663        DLOG(L<<"There is some data, but not of the correct type, checking fancy records"<<endl); 
     664        int res=doFancyRecords(p,r,target); 
     665        if(res) { // had a result 
     666          if(res<0) // it was an error 
     667            r->setRcode(RCode::ServFail); 
     668          goto sendit;   
     669        } 
     670      } 
    663671      DLOG(L<<"There is some data, but not of the correct type, adding SOA for NXRECORDSET"<<endl); 
    664672      SOAData sd; 
     
    679687      goto sendit; // this might be the end of it (client requested a CNAME, or we found the answer already) 
    680688 
    681     if(d_doFancyRecords) { // MBOXFW, URL <- fake records, emulated with MX and A 
    682       int res=doFancyRecords(p,r,target); 
    683       if(res) { // had a result 
    684         if(res<0) // it was an error 
    685           r->setRcode(RCode::ServFail); 
    686         goto sendit;   
    687       } 
    688     } 
    689689     
    690690    // now ready to start the real direct search 
  • trunk/pdns/pdns/sdig.cc

    r1277 r1299  
    3232  nrc2.toPacket(pw); 
    3333  */ 
    34  
     34  /* 
    3535  DNSPacketWriter::optvect_t opts; 
    3636  string ping("hallo!"); 
     
    3838  pw.addOpt(5200, 0, 0x8000, opts); 
    3939  pw.commit(); 
    40  
     40  */ 
    4141  Socket sock(InterNetwork, Datagram); 
    4242  IPEndpoint dest(argv[1] + (*argv[1]=='@'), atoi(argv[2])); 
    43  
    4443  sock.sendTo(string((char*)&*packet.begin(), (char*)&*packet.end()), dest); 
    4544   
     
    5655    cout<<"\t"<<i->first.d_ttl<<"\t"<< i->first.d_content->getZoneRepresentation()<<"\n"; 
    5756  } 
    58  
     57#if 0 
    5958  EDNSOpts edo; 
    6059  if(getEDNSOpts(mdp, &edo)) { 
     
    7271 
    7372  } 
     73#endif 
    7474} 
    7575catch(std::exception &e)