static int chartocode(const char *p); //!< convert a character string to a code
enum typeenum {A=1,NS=2,CNAME=5,SOA=6, MR=9, PTR=12,HINFO=13,MX=15,TXT=16,RP=17,AFSDB=18,KEY=25,AAAA=28,LOC=29,SRV=33,NAPTR=35, OPT=41,
- SPF=99, AXFR=252, IXFR=251, ANY=255, URL=256, MBOXFW=257, CURL=258} types;
+ SPF=99, AXFR=252, IXFR=251, ANY=255, URL=256, MBOXFW=257, CURL=258, ADDR=259} types;
private:
short int code;
typedef pair<string,int> namenum;
if(d_cachecache.first!=d_cachecache.second) {
for(cache_t::const_iterator i=d_cachecache.first; i != d_cachecache.second; ++i)
- if(i->d_qtype == qt.getCode() || qt.getCode()==QType::ANY) {
+ if(i->d_qtype == qt.getCode() || qt.getCode()==QType::ANY ||
+ (qt.getCode()==QType::ADDR && (i->d_qtype == QType::A || i->d_qtype == QType::AAAA) )
+ ) {
typedef cache_t::nth_index<1>::type sequence_t;
sequence_t& sidx=d_cache.get<1>();
sequence_t::iterator si=d_cache.project<1>(i);
else
sidx.relocate(sidx.end(), si);
}
- if(qt.getCode()!=QType::ANY) // normally if we have a hit, we are done
+ if(qt.getCode()!=QType::ANY && qt.getCode()!=QType::ADDR) // normally if we have a hit, we are done
break;
}
if(qt.getCode()==QType::SOA || qt.getCode()==QType::CNAME) // you can only have one (1) each of these
ce.d_records.clear();
- if(auth && !ce.d_auth) {
+ if(auth /* && !ce.d_auth */ ) {
ce.d_records.clear(); // clear non-auth data
ce.d_auth = true;
isNew=true; // data should be sorted again