]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
Fix Message.want_dnssec().
authorBrian Wellington <bwelling@xbill.org>
Tue, 7 Jul 2020 17:44:04 +0000 (10:44 -0700)
committerBrian Wellington <bwelling@xbill.org>
Tue, 7 Jul 2020 17:47:22 +0000 (10:47 -0700)
It was incorrectly calling Message._make_opt() in the case where the
message was not currently using EDNS.

dns/message.py
tests/test_message.py

index 43b837a82084f98bb5848fa02650cd22b064327b..1bb02ae23a2e8029e0741bfd0f0d66840dd8839b 100644 (file)
@@ -615,7 +615,7 @@ class Message:
         if self.opt:
             self.opt.ttl = v
         else:
-            self.opt = self._make_opt(0, v)
+            self.opt = self._make_opt(v)
 
     @property
     def payload(self):
index 1a5dceaf4168f4bd773b5825abe69a3816ce2931..4eb48d3a7653c5a24db563c4bc597a22951c8a1c 100644 (file)
@@ -336,6 +336,7 @@ class MessageTestCase(unittest.TestCase):
         self.assertEqual(m.edns, -1)
         m.want_dnssec()
         self.assertEqual(m.edns, 0)
+        self.assertTrue(m.ednsflags & dns.flags.DO)
 
     def test_from_file(self):
         m = dns.message.from_file(here('query'))