]> granicus.if.org Git - pdns/commitdiff
only deal with (1) EDNS record
authorbert hubert <bert.hubert@netherlabs.nl>
Sun, 6 Mar 2016 09:57:52 +0000 (10:57 +0100)
committerbert hubert <bert.hubert@netherlabs.nl>
Sun, 6 Mar 2016 09:57:52 +0000 (10:57 +0100)
pdns/pdns_recursor.cc

index c21c2fa16e0e1bed25935fc800d77cc9d5c5c267..311008aa5d9dd01a890ce636a8f17c3a60ac848b 100644 (file)
@@ -1159,7 +1159,7 @@ string* doProcessUDPQuestion(const std::string& question, const ComboAddress& fr
         DNSName qname(question.c_str(), question.length(), sizeof(dnsheader), false, &qtype, 0, &consumed);
         Netmask ednssubnet;
         auto pos= sizeof(dnsheader)+consumed+4;        
-        if(dh->arcount && question.length() > pos + 16) { // this code can extract one (1) EDNS Subnet option
+        if(ntohs(dh->arcount) == 1 && question.length() > pos + 16) { // this code can extract one (1) EDNS Subnet option
           uint16_t optlen=0x100*question.at(pos+9)+question.at(pos+10);
           uint16_t optcode=0x100*question.at(pos+11)+question.at(pos+12);
           if(question.at(pos)==0 && question.at(pos+1)==0 && question.at(pos+2)==QType::OPT && optlen && optcode==8) {