From 90743984522761eb0ad6ea806a0737d57080fcb2 Mon Sep 17 00:00:00 2001 From: bert hubert Date: Sun, 6 Mar 2016 10:57:52 +0100 Subject: [PATCH] only deal with (1) EDNS record --- pdns/pdns_recursor.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pdns/pdns_recursor.cc b/pdns/pdns_recursor.cc index c21c2fa16..311008aa5 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) { -- 2.40.0