From: Remi Gacogne Date: Thu, 20 Sep 2018 12:46:11 +0000 (+0200) Subject: rec: Keep the EDNS status of a server on FormErr with EDNS X-Git-Tag: rec-4.0.9^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c4475b556cd644017cc63d99922f89840924589c;p=pdns rec: Keep the EDNS status of a server on FormErr with EDNS 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) --- diff --git a/pdns/syncres.cc b/pdns/syncres.cc index 434b29fd4..52068002f 100644 --- a/pdns/syncres.cc +++ b/pdns/syncres.cc @@ -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 "<d_rcode)<<" for query to "<