}
if (ids->packetCache && !ids->skipCache) {
- ids->packetCache->insert(zeroScope ? ids->cacheKeyNoECS : ids->cacheKey, ids->subnet, ids->origFlags, ids->dnssecOK, ids->qname, ids->qtype, ids->qclass, response, responseLen, false, dh->rcode, ids->tempFailureTTL);
+ // if zeroScope, pass the pre-ECS hash-key and do not pass the subnet to the cache
+ ids->packetCache->insert(zeroScope ? ids->cacheKeyNoECS : ids->cacheKey, zeroScope ? boost::none : ids->subnet, ids->origFlags, ids->dnssecOK, ids->qname, ids->qtype, ids->qclass, response, responseLen, false, dh->rcode, ids->tempFailureTTL);
}
if (ids->cs && !ids->cs->muted) {
}
if (dq.useECS && ((ss && ss->useECS) || (!ss && serverPool->getECS()))) {
+ // we special case our cache in case a downstream explicitly gave us a universally valid resposne with a 0 scope
if (packetCache && !dq.skipCache && packetCache->get(dq, consumed, dh->id, query, &cachedResponseSize, &cacheKeyNoECS, subnet, dnssecOK, allowExpired)) {
goto sendIt;
}