From c0605ec32c28597aa622788b0f367e52b4b07c0e Mon Sep 17 00:00:00 2001 From: Pieter Lexis Date: Tue, 12 Sep 2017 12:28:33 +0200 Subject: [PATCH] Allow no-EDNS fallback when DNSSEC is needed --- pdns/syncres.cc | 7 +++++-- pdns/syncres.hh | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/pdns/syncres.cc b/pdns/syncres.cc index 653c17682b..993db5e8f9 100644 --- a/pdns/syncres.cc +++ b/pdns/syncres.cc @@ -324,7 +324,7 @@ void SyncRes::doEDNSDumpAndClose(int fd) For now this means we can't be clever, but will turn off DNSSEC if you reply with FormError or gibberish. */ -int SyncRes::asyncresolveWrapper(const ComboAddress& ip, bool ednsMANDATORY, const DNSName& domain, int type, bool doTCP, bool sendRDQuery, struct timeval* now, boost::optional& srcmask, LWResult* res) +int SyncRes::asyncresolveWrapper(const ComboAddress& ip, bool wantsEDNS, const DNSName& domain, int type, bool doTCP, bool sendRDQuery, struct timeval* now, boost::optional& srcmask, LWResult* res) { /* what is your QUEST? the goal is to get as many remotes as possible on the highest level of EDNS support @@ -369,9 +369,12 @@ int SyncRes::asyncresolveWrapper(const ComboAddress& ip, bool ednsMANDATORY, con if(mode==EDNSStatus::NOEDNS) { g_stats.noEdnsOutQueries++; + if (wantsEDNS) { + LOG("Remote " + ip.toString() + " does not support EDNS!"); + } EDNSLevel = 0; // level != mode } - else if(ednsMANDATORY || mode==EDNSStatus::UNKNOWN || mode==EDNSStatus::EDNSOK || mode==EDNSStatus::EDNSIGNORANT) + else if(mode==EDNSStatus::UNKNOWN || mode==EDNSStatus::EDNSOK || mode==EDNSStatus::EDNSIGNORANT) EDNSLevel = 1; ret=asyncresolve(ip, domain, type, doTCP, sendRDQuery, EDNSLevel, now, srcmask, ctx, luaconfsLocal->outgoingProtobufServer, res); diff --git a/pdns/syncres.hh b/pdns/syncres.hh index 26b2a9cccd..af00d816cc 100644 --- a/pdns/syncres.hh +++ b/pdns/syncres.hh @@ -352,7 +352,7 @@ public: d_skipCNAMECheck = skip; } - int asyncresolveWrapper(const ComboAddress& ip, bool ednsMANDATORY, const DNSName& domain, int type, bool doTCP, bool sendRDQuery, struct timeval* now, boost::optional& srcmask, LWResult* res); + int asyncresolveWrapper(const ComboAddress& ip, bool wantsEDNS, const DNSName& domain, int type, bool doTCP, bool sendRDQuery, struct timeval* now, boost::optional& srcmask, LWResult* res); static void doEDNSDumpAndClose(int fd); static std::atomic s_queries; -- 2.47.2