]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
rec: Keep the EDNS status of a server on FormErr with EDNS 7152/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 20 Sep 2018 12:46:11 +0000 (14:46 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 11 Oct 2018 09:37:53 +0000 (11:37 +0200)
Note that the choice of DNAME in the unit test is an arbitrary
choice, we could even have used A here.

(cherry picked from commit 6fb756b6cd49d61eacf7865ce48d0edb62730710)
(cherry picked from commit e8cc6a136087c5ede35f55b3a67902dcb0030165)

pdns/syncres.cc

index 434b29fd479417788b2b884456b823be0785b09d..52068002f3e7f24c1edc8d19a3ab9aa86eb08d95 100644 (file)
@@ -396,7 +396,7 @@ int SyncRes::asyncresolveWrapper(const ComboAddress& ip, bool wantsEDNS, const D
       return ret;
     }
     else if(mode==EDNSStatus::UNKNOWN || mode==EDNSStatus::EDNSOK || mode == EDNSStatus::EDNSIGNORANT ) {
-      if(res->d_rcode == RCode::FormErr || res->d_rcode == RCode::NotImp)  {
+      if(!res->d_haveEDNS && (res->d_rcode == RCode::FormErr || res->d_rcode == RCode::NotImp)) {
        //      cerr<<"Downgrading to NOEDNS because of "<<RCode::to_s(res->d_rcode)<<" for query to "<<ip.toString()<<" for '"<<domain<<"'"<<endl;
         mode = EDNSStatus::NOEDNS;
         continue;