Changeset 761

Show
Ignore:
Timestamp:
04/22/06 17:30:35 (4 years ago)
Author:
ahu
Message:

fix david g's bug one level up as well - we used to do the wrong thing with truncated packets, leaving untrue an, ns and arcounts around
change version to 3.0.1-snapshot

Location:
trunk/pdns/pdns
Files:
6 modified

Legend:

Unmodified
Added
Removed
  • trunk/pdns/pdns/config-recursor.h

    r753 r761  
    11#define SYSCONFDIR "/etc/powerdns/"  
    22#define LOCALSTATEDIR "/var/run/"  
    3 #define VERSION "3.0" 
     3#define VERSION "3.0.1-snapshot" 
    44#define RECURSOR 
    55#define GCC_SKIP_LOCKING 
  • trunk/pdns/pdns/dist-recursor

    r752 r761  
    1 VERSION=3.0 
     1VERSION=3.0.1-snapshot 
    22 
    33INCLUDES="iputils.hh arguments.hh base64.hh zoneparser-tng.hh \ 
  • trunk/pdns/pdns/dnsparser.cc

    r760 r761  
    189189  copy(packet+sizeof(dnsheader), packet+len, d_content.begin()); 
    190190   
    191   unsigned int n; 
     191  unsigned int n=0; 
    192192 
    193193  PacketReader pr(d_content); 
     
    235235  } 
    236236  catch(out_of_range &re) { 
    237     if(!(validPacket && d_header.tc)) // don't sweat it over truncated packets 
     237    if(validPacket && d_header.tc) { // don't sweat it over truncated packets, but do adjust an, ns and arcount 
     238      if(n < d_header.ancount) { 
     239        d_header.ancount=n; d_header.nscount = d_header.arcount = 0; 
     240      } 
     241      else if(n < d_header.ancount + d_header.nscount) { 
     242        d_header.nscount = n - d_header.ancount; d_header.arcount=0; 
     243      } 
     244      else { 
     245        d_header.arcount = n - d_header.ancount - d_header.nscount; 
     246      } 
     247    } 
     248    else { 
    238249      throw MOADNSException("Error parsing packet of "+lexical_cast<string>(len)+" bytes (rd="+ 
    239250                            lexical_cast<string>(d_header.rd)+ 
    240251                            "), out of bounds: "+string(re.what())); 
     252    } 
    241253  } 
    242254} 
  • trunk/pdns/pdns/dnsscan.cc

    r691 r761  
    3939      for(int i=0; i < mdp.d_qname.length(); ++i) 
    4040        if(!isalnum(mdp.d_qname[i]) && mdp.d_qname[i]!='.' && mdp.d_qname[i]!='-' && mdp.d_qname[i]!='_') { 
    41           cout<<mdp.d_qname<<"|"<<mdp.d_qtype<<"|"<<mdp.d_qclass<<"\n"; 
    42           sock.sendTo(string(pr.d_payload, pr.d_payload + pr.d_len), remote); 
     41          //      cout<<mdp.d_qname<<"|"<<mdp.d_qtype<<"|"<<mdp.d_qclass<<"\n"; 
     42          // sock.sendTo(string(pr.d_payload, pr.d_payload + pr.d_len), remote); 
    4343          break; 
    4444        } 
     
    5353    } 
    5454    catch(MOADNSException &e) { 
    55       cerr<<"Error: "<<e.what()<<"\n"; 
     55      cout<<"Error: "<<e.what()<<"\n"; 
    5656      sock.sendTo(string(pr.d_payload, pr.d_payload + pr.d_len), remote); 
    5757    } 
     
    6060catch(exception& e) 
    6161{ 
    62   cerr<<"Fatal: "<<e.what()<<endl; 
     62  cout<<"Fatal: "<<e.what()<<endl; 
    6363} 
    6464 
  • trunk/pdns/pdns/docs/pdns.sgml

    r755 r761  
    85048504        </para> 
    85058505        <para> 
     8506          Zone2sql with the --gmysql flag also assumes this layout is in place. 
     8507        </para> 
     8508        <para> 
    85068509          This schema contains all elements needed for master, slave and superslave operation. Depending on which features will be used, the 'GRANT' statements 
    85078510          can be trimmed to make sure PDNS cannot subvert the contents of your database. 
    85088511        </para> 
    85098512        <para> 
    8510           Zone2sql with the --gmysql flag also assumes this layout is in place. 
     8513          When using the InnoDB storage engine, we suggest adding the following lines to the 'create table records' command above: 
     8514<programlisting> 
     8515CONSTRAINT `records_ibfk_1` FOREIGN KEY (`domain_id`) REFERENCES `domains` 
     8516(`id`) ON DELETE CASCADE 
     8517</programlisting> 
     8518        </para> 
     8519        <para> 
     8520          This automates deletion of records on deletion of a domain from the domains table. 
    85118521        </para> 
    85128522      </sect2> 
  • trunk/pdns/pdns/pdns-recursor.spec

    r753 r761  
    33Buildroot: /tmp/pdns/ 
    44Name: pdns-recursor 
    5 Version: 3.0 
     5Version: 3.0.1snapshot 
    66Release: 1 
    77Summary: extremely powerful and versatile recursing nameserver