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.
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