int result=0;
unsigned int n;
for(n = 0; n < aLabelLen && n < bLabelLen; ++n)
- if((result = aSafe[aPos + n] - bSafe[bPos +n]))
+ if((result = aSafe[aPos + n] - bSafe[bPos +n])) // XXX this should perhaps be dns_tolower
break;
// cerr<<"Done loop, result="<<result<<", n = "<<n<<", aLabelLen="<<aLabelLen<<", bLabelLen="<<bLabelLen<<endl;
if(result < 0)
int RecursorPacketCache::doWipePacketCache(const string& name, uint16_t qtype)
{
vector<uint8_t> packet;
- DNSPacketWriter pw(packet, name, 0);
+ DNSPacketWriter pw(packet, toLower(name), 0);
pw.getHeader()->rd=1;
Entry e;
- e.d_packet.assign(&*packet.begin(), &*packet.end());
+ e.d_packet.assign((const char*)&*packet.begin(), packet.size());
// so the idea is, we search for a packet with qtype=0, which is ahead of anything with that name
break;
uint16_t t;
string found=questionExpand(iter->d_packet.c_str(), iter->d_packet.length(), t);
- if(found != name) {
+ if(!pdns_iequals(found, name)) {
break;
}
if(t==qtype || qtype==0xffff) {