]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
Fix want_dnssec semantics.
authorBrian Wellington <bwelling@xbill.org>
Thu, 10 Apr 2025 22:21:11 +0000 (15:21 -0700)
committerBrian Wellington <bwelling@xbill.org>
Thu, 10 Apr 2025 22:21:11 +0000 (15:21 -0700)
Calling dns.message.make_query() with ednsflags including dns.flags.DO
didn't work properly.  The code would call Message.use_edns(), which
would do the right thing, and then call Message.want_dnssec(false)
because want_dnssec defaults False, which would overwrite the flags with
the wrong value.

This slightly changes the semantics, to make want_dnssec only have an
effect if it's True.  That's already what the documentation says.

dns/message.py

index c655b02c8ead9ad7c12ecced2325365d9fc6c650..1288b20588a72164f391590e4da85625cb122ce2 100644 (file)
@@ -1837,7 +1837,8 @@ def make_query(
     kwargs["edns"] = use_edns
     kwargs["pad"] = pad
     m.use_edns(**kwargs)
-    m.want_dnssec(want_dnssec)
+    if want_dnssec:
+        m.want_dnssec(want_dnssec)
     return m