return qname[qname.size()-1]=='.';
}
-inline bool isCanonical(const DNSName& qname)
-{
- if(qname.empty())
- return false;
- return true;
-}
-
-
inline DNSName toCanonic(const DNSName& zone, const string& qname)
{
if(qname.size()==1 && qname[0]=='@')
if( iter->second.d_servers.empty() )
nsset.insert({DNSName(), {ComboAddress(), false}}); // this gets picked up in doResolveAt, the empty DNSName, combined with the empty ComboAddress means 'we are auth'
else {
- for(auto const &server : iter->second.d_servers)
+ for(auto const &server : iter->second.d_servers) {
nsset.insert({DNSName(), {server, iter->second.d_rdForward}}); // An empty DNSName, combined with a non-empty ComboAddress means 'this is a forwarded domain'
+ }
}
return authdomain;
}
if(g_luaconfs.getLocal()->dfe.getProcessingPolicy(*tns).d_kind != DNSFilterEngine::PolicyKind::NoAction)
throw ImmediateServFailException("Dropped because of policy");
- if(!isCanonical(*tns)) {
+ if(tns->empty()) {
LOG(prefix<<qname.toString()<<": Domain has hardcoded nameserver(s)"<<endl);
remoteIPs.push_back(nameservers[*tns].first);
nameservers.insert({nameserver, {ComboAddress(), false}});
break;
}
- else if(isCanonical(*tns)) { // means: not OOB (I think)
+ else if(!tns->empty()) { // means: not OOB, OOB == empty
goto wasLame;
}
}