From: Peter van Dijk Date: Thu, 29 Nov 2018 11:33:56 +0000 (+0100) Subject: Merge pull request #6731 from chbruyand/auth-luarec-issues X-Git-Tag: auth-4.2.0-alpha1~19 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c0457fec587636876b110353a5eccaa80ec773b3;p=pdns Merge pull request #6731 from chbruyand/auth-luarec-issues Address Auth LUA Records issues --- c0457fec587636876b110353a5eccaa80ec773b3 diff --cc pdns/packethandler.cc index a39ab106c,5d13d70d0..fff6f7305 --- a/pdns/packethandler.cc +++ b/pdns/packethandler.cc @@@ -383,23 -383,15 +383,18 @@@ bool PacketHandler::getBestWildcard(DNS DLOG(g_log<<"Have a wildcard LUA match"<(rr.dr); - if(rec->d_type == QType::CNAME || rec->d_type == p->qtype.getCode()) { + if (!rec) { + continue; + } + if(rec->d_type == QType::CNAME || rec->d_type == p->qtype.getCode() || (p->qtype.getCode() == QType::ANY && rec->d_type != QType::RRSIG)) { // noCache=true; DLOG(g_log<<"Executing Lua: '"<getCode()<<"'"<getCode(), target, sd.qname, sd.domain_id, *p, rec->d_type); - for(const auto& r : recvec) { - rr.dr.d_type = rec->d_type; // might be CNAME - rr.dr.d_content = r; - rr.scopeMask = p->getRealRemote().getBits(); // this makes sure answer is a specific as your question - ret->push_back(rr); - } - } - catch(std::exception &e) { - ; + auto recvec=luaSynth(rec->getCode(), target, sd.qname, sd.domain_id, *p, rec->d_type); + for(const auto& r : recvec) { + rr.dr.d_type = rec->d_type; // might be CNAME + rr.dr.d_content = r; + rr.scopeMask = p->getRealRemote().getBits(); // this makes sure answer is a specific as your question + ret->push_back(rr); } } }