According to the documentation on UeberBackend::getAuth(), a backend
returning an empty DNSName should signal that no matching parent zone
exists in this backend. However commit
ae14c1f36a raises an exception if
isPartOf() is called on an empty DNSName so we need to switch the order
of the logic to prevent a SERVFAIL as a result.
DLOG(g_log<<Logger::Error<<"lookup: "<<shorter<<endl);
if((*i)->getAuth(shorter, sd)) {
DLOG(g_log<<Logger::Error<<"got: "<<sd->qname<<endl);
- if(!shorter.isPartOf(sd->qname) && !sd->qname.empty()) {
+ if(!sd->qname.empty() && !shorter.isPartOf(sd->qname)) {
throw PDNSException("getAuth() returned an SOA for the wrong zone. Zone '"+sd->qname.toLogString()+"' is not part of '"+shorter.toLogString()+"'");
}
j->first = sd->qname.wirelength();