]> granicus.if.org Git - pdns/commitdiff
rec: Use ECS when updating the validation state if needed
authorRemi Gacogne <remi.gacogne@powerdns.com>
Sat, 1 Jul 2017 22:12:05 +0000 (00:12 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Sat, 1 Jul 2017 22:12:05 +0000 (00:12 +0200)
If `use-incoming-ecs` is set and an actual ECS value was received.

pdns/syncres.cc

index 8fa0f957694384b95c659f59eea6ff673be54a28..416dfd02500b98a6b3d2ceb8a963e972624c994c 100644 (file)
@@ -834,7 +834,7 @@ bool SyncRes::doCNAMECacheCheck(const DNSName &qname, const QType &qtype, vector
             state = SyncRes::validateRecordsWithSigs(depth, qname, QType(QType::CNAME), qname, cset, signatures);
             if (state != Indeterminate) {
               LOG(prefix<<qname<<": got Indeterminate state from the CNAME cache, new validation result is "<<vStates[state]<<endl);
-              t_RC->updateValidationStatus(d_now.tv_sec, qname, QType(QType::CNAME), d_requestor, d_requireAuthData, state);
+              t_RC->updateValidationStatus(d_now.tv_sec, qname, QType(QType::CNAME), d_incomingECSFound ? d_incomingECSNetwork : d_requestor, d_requireAuthData, state);
             }
           }
         }
@@ -992,7 +992,7 @@ bool SyncRes::doCacheCheck(const DNSName &qname, const QType &qtype, vector<DNSR
 
         if (cachedState != Indeterminate) {
           LOG(prefix<<qname<<": got Indeterminate state from the cache, validation result is "<<vStates[cachedState]<<endl);
-          t_RC->updateValidationStatus(d_now.tv_sec, sqname, sqt, d_requestor, d_requireAuthData, cachedState);
+          t_RC->updateValidationStatus(d_now.tv_sec, sqname, sqt, d_incomingECSFound ? d_incomingECSNetwork : d_requestor, d_requireAuthData, cachedState);
         }
       }
     }