From: bert hubert Date: Sun, 6 Mar 2016 09:57:52 +0000 (+0100) Subject: only deal with (1) EDNS record X-Git-Tag: rec-4.0.0-alpha2~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=90743984522761eb0ad6ea806a0737d57080fcb2;p=thirdparty%2Fpdns.git only deal with (1) EDNS record --- diff --git a/pdns/pdns_recursor.cc b/pdns/pdns_recursor.cc index c21c2fa16e..311008aa5d 100644 --- a/pdns/pdns_recursor.cc +++ b/pdns/pdns_recursor.cc @@ -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) {