]> granicus.if.org Git - pdns/commitdiff
Allow no-EDNS fallback when DNSSEC is needed
authorPieter Lexis <pieter.lexis@powerdns.com>
Tue, 12 Sep 2017 10:28:33 +0000 (12:28 +0200)
committerPieter Lexis <pieter.lexis@powerdns.com>
Mon, 2 Oct 2017 13:30:34 +0000 (15:30 +0200)
pdns/syncres.cc
pdns/syncres.hh

index 653c17682ba2282c11fd38b68bd581447910a4e9..993db5e8f939cd138f62b5688582f2d01efa1785 100644 (file)
@@ -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<Netmask>& 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<Netmask>& 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);
index 26b2a9cccd2dcaa446205e119b4989b28f92961a..af00d816cc05141d5bca09304f0414f68af9c7c7 100644 (file)
@@ -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<Netmask>& srcmask, LWResult* res);
+  int asyncresolveWrapper(const ComboAddress& ip, bool wantsEDNS, const DNSName& domain, int type, bool doTCP, bool sendRDQuery, struct timeval* now, boost::optional<Netmask>& srcmask, LWResult* res);
   static void doEDNSDumpAndClose(int fd);
 
   static std::atomic<uint64_t> s_queries;