Changeset acd264


Ignore:
Timestamp:
09/21/09 22:35:18 (3 years ago)
Author:
Erik Ekman <yarrick@…>
Branches:
master
Children:
365aab
Parents:
269499
git-author:
Erik Ekman <yarrick@…> (09/21/09 22:35:18)
git-committer:
Erik Ekman <erik@…> (02/04/12 20:34:04)
Message:

Make sure replies with errors get the name parsed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/dns.c

    r269499 racd264  
    303303        switch (qr) { 
    304304        case QR_ANSWER: 
    305                 if(qdcount < 1 || ancount < 1) { 
    306                         /* We may get both CNAME and A, then ancount=2 */ 
     305                if(qdcount < 1) { 
     306                        /* We need a question */ 
    307307                        return -1; 
    308308                } 
     
    311311                        q->id = id; 
    312312 
     313                /* Read name even if no answer, to give better error message */ 
    313314                readname(packet, packetlen, &data, name, sizeof(name)); 
    314315                CHECKLEN(4); 
     
    321322                        q->name[0] = name[0]; 
    322323                        q->name[1] = '\0'; 
     324                }  
     325                 
     326                if (ancount < 1) { 
     327                        /* We may get both CNAME and A, then ancount=2 */ 
     328                        return -1; 
    323329                } 
    324330 
Note: See TracChangeset for help on using the changeset viewer.