From: Remi Gacogne Date: Fri, 13 Jan 2017 16:40:02 +0000 (+0100) Subject: Revert "auth: In `Bind2Backend::lookup()`, use the `zoneId` when we have it" X-Git-Tag: auth-4.0.3^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e92524b89039fb0ce817477b059c6985529d140e;p=thirdparty%2Fpdns.git Revert "auth: In `Bind2Backend::lookup()`, use the `zoneId` when we have it" This reverts commit 937a66255ff05f2e754ef113833e54cc4cf2004b. It doesn't work with multiple backends since the `zoneId` is passed to every available backend on `lookup()`. (cherry picked from commit 98b9845f2dae3a9fecc64aecaf41150b54388d26) --- diff --git a/modules/bindbackend/bindbackend2.cc b/modules/bindbackend/bindbackend2.cc index 4f9b06fc76..3baf25ebb4 100644 --- a/modules/bindbackend/bindbackend2.cc +++ b/modules/bindbackend/bindbackend2.cc @@ -1036,17 +1036,9 @@ void Bind2Backend::lookup(const QType &qtype, const DNSName &qname, DNSPacket *p bool found=false; BB2DomainInfo bbd; - if (zoneId != -1) { - found = safeGetBBDomainInfo(zoneId, &bbd); - if (found) { - domain = bbd.d_name; - } - } - else { - do { - found = safeGetBBDomainInfo(domain, &bbd); - } while (!found && domain.chopOff()); - } + do { + found = safeGetBBDomainInfo(domain, &bbd); + } while ((!found || (zoneId != (int)bbd.d_id && zoneId != -1)) && domain.chopOff()); if(!found) { if(mustlog)