]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
allow all EDNS parameters to be specifed when making a query
authorBob Halley <halley@nominum.com>
Sun, 8 Apr 2012 12:55:48 +0000 (13:55 +0100)
committerBob Halley <halley@nominum.com>
Sun, 8 Apr 2012 12:55:48 +0000 (13:55 +0100)
ChangeLog
README
dns/message.py

index 173699932d57a32c83b7c76d1e7cf411ac8deec3..876acfd16dd97e325985584f5f12babf471ce004 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2012-04-08  Bob Halley  <halley@dnspython.org>
 
+       * dns/message.py (make_query): All EDNS values may now be
+         specified when calling make_query()
+
        * dns/query.py: Specifying source_port had no effect if source was
          not specified.  We now use the appropriate wildcard source in
          that case.
diff --git a/README b/README
index 76faeffae69813f095a5f5747fb686bf2be506c9..d372817dfc73dba9f75b34179960bdf2ed077964 100644 (file)
--- a/README
+++ b/README
@@ -49,6 +49,8 @@ New since 1.9.4:
 
        A source port can be specified when creating a resolver query.
 
+       All EDNS values may now be specified to dns.message.make_query().
+
 Bugs fixed since 1.9.4:
 
        IPv4 and IPv6 address processing is now stricter.
index e78ec5059d1f990c6b3872b28a630cbcabfeb850..85096f3ac84d8da600250a426dcf71caa8e78eed 100644 (file)
@@ -1016,7 +1016,8 @@ def from_file(f):
     return m
 
 def make_query(qname, rdtype, rdclass = dns.rdataclass.IN, use_edns=None,
-               want_dnssec=False):
+               want_dnssec=False, ednsflags=0, payload=1280,
+               request_payload=None, options=None):
     """Make a query message.
 
     The query name, type, and class may all be specified either
@@ -1037,6 +1038,17 @@ def make_query(qname, rdtype, rdclass = dns.rdataclass.IN, use_edns=None,
     @type use_edns: int or bool or None
     @param want_dnssec: Should the query indicate that DNSSEC is desired?
     @type want_dnssec: bool
+    @param ednsflags: EDNS flag values.
+    @type ednsflags: int
+    @param payload: The EDNS sender's payload field, which is the maximum
+    size of UDP datagram the sender can handle.
+    @type payload: int
+    @param request_payload: The EDNS payload size to use when sending
+    this message.  If not specified, defaults to the value of payload.
+    @type request_payload: int or None
+    @param options: The EDNS options
+    @type options: None or list of dns.edns.Option objects
+    @see: RFC 2671
     @rtype: dns.message.Message object"""
 
     if isinstance(qname, str):
@@ -1049,7 +1061,7 @@ def make_query(qname, rdtype, rdclass = dns.rdataclass.IN, use_edns=None,
     m.flags |= dns.flags.RD
     m.find_rrset(m.question, qname, rdclass, rdtype, create=True,
                  force_unique=True)
-    m.use_edns(use_edns)
+    m.use_edns(use_edns, ednsflags, payload, request_payload, options)
     m.want_dnssec(want_dnssec)
     return m