]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
EDNS: Ensure not query processing happens on EDNS error
authorPieter Lexis <pieter.lexis@powerdns.com>
Thu, 19 Apr 2018 08:27:00 +0000 (10:27 +0200)
committerPieter Lexis <pieter.lexis@powerdns.com>
Wed, 30 May 2018 08:00:52 +0000 (10:00 +0200)
pdns/pdns_recursor.cc
regression-tests.recursor-dnssec/test_EDNS.py

index 8bdc0c139947f2ffcc6afa41bf5c678921cf8d8e..c8c93c7d014f8f91a27981dcc17be1546423647b 100644 (file)
@@ -990,6 +990,10 @@ static void startDoResolve(void *p)
     dq.deviceId = dc->d_deviceId;
 #endif
 
+    if(ednsExtRCode != 0) {
+      goto sendit;
+    }
+
     if(dc->d_mdp.d_qtype==QType::ANY && !dc->d_tcp && g_anyToTcp) {
       pw.getHeader()->tc = 1;
       res = 0;
index eebbc2f2c7978f2bdc1a985fb2b507c3e967ed40..b81849f4e70009b1a6aca5ee7bd680d2e980e44d 100644 (file)
@@ -33,9 +33,11 @@ class EDNSTest(RecursorTest):
 
     def testEDNSBadVers(self):
         """
-        Ensure the rcode is BADVERS when we send an unsupported EDNS version
+        Ensure the rcode is BADVERS when we send an unsupported EDNS version and
+        the query is not processed any further.
         """
         query = dns.message.make_query('version.bind.', 'TXT', 'CH', use_edns=5,
                                        payload=4096)
         response = self.sendUDPQuery(query)
         self.assertRcodeEqual(response, dns.rcode.BADVERS)
+        self.assertEqual(response.answer, [])