summaryrefslogtreecommitdiff
path: root/lib/dnspython/dns
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2010-12-20 02:31:40 +0100
committerJelmer Vernooij <jelmer@samba.org>2010-12-20 03:21:52 +0100
commite1d3de3e173e2e1b31cfe0c7e8483eb205f4bb2d (patch)
tree3b9081680b2f63bc53f6688829d6ae1639a474b1 /lib/dnspython/dns
parent145868db15a67675492fbac52d9aecfa4dcf8c84 (diff)
downloadsamba-e1d3de3e173e2e1b31cfe0c7e8483eb205f4bb2d.tar.gz
samba-e1d3de3e173e2e1b31cfe0c7e8483eb205f4bb2d.tar.bz2
samba-e1d3de3e173e2e1b31cfe0c7e8483eb205f4bb2d.zip
dnspython: Merge in new upstream.
Autobuild-User: Jelmer Vernooij <jelmer@samba.org> Autobuild-Date: Mon Dec 20 03:21:52 CET 2010 on sn-devel-104
Diffstat (limited to 'lib/dnspython/dns')
-rw-r--r--lib/dnspython/dns/message.py2
-rw-r--r--lib/dnspython/dns/rdata.py4
-rw-r--r--lib/dnspython/dns/resolver.py8
-rw-r--r--lib/dnspython/dns/version.py2
4 files changed, 14 insertions, 2 deletions
diff --git a/lib/dnspython/dns/message.py b/lib/dnspython/dns/message.py
index 5ec711e1eb..a124a3e177 100644
--- a/lib/dnspython/dns/message.py
+++ b/lib/dnspython/dns/message.py
@@ -686,7 +686,7 @@ class _WireReader(object):
deleting = None
if deleting == dns.rdataclass.ANY or \
(deleting == dns.rdataclass.NONE and \
- section == self.message.answer):
+ section is self.message.answer):
covers = dns.rdatatype.NONE
rd = None
else:
diff --git a/lib/dnspython/dns/rdata.py b/lib/dnspython/dns/rdata.py
index ce0268697b..399677e984 100644
--- a/lib/dnspython/dns/rdata.py
+++ b/lib/dnspython/dns/rdata.py
@@ -28,6 +28,7 @@ chunk of hexstring that _hexify() produces before whitespace occurs.
import cStringIO
import dns.exception
+import dns.name
import dns.rdataclass
import dns.rdatatype
import dns.tokenizer
@@ -252,6 +253,9 @@ class Rdata(object):
return NotImplemented
return self._cmp(other) > 0
+ def __hash__(self):
+ return hash(self.to_digestable(dns.name.root))
+
def from_text(cls, rdclass, rdtype, tok, origin = None, relativize = True):
"""Build an rdata object from text format.
diff --git a/lib/dnspython/dns/resolver.py b/lib/dnspython/dns/resolver.py
index f803eb6d20..30977f3a8b 100644
--- a/lib/dnspython/dns/resolver.py
+++ b/lib/dnspython/dns/resolver.py
@@ -61,6 +61,10 @@ class NoRootSOA(dns.exception.DNSException):
This should never happen!"""
pass
+class NoMetaqueries(dns.exception.DNSException):
+ """Metaqueries are not allowed."""
+ pass
+
class Answer(object):
"""DNS stub resolver answer
@@ -571,8 +575,12 @@ class Resolver(object):
qname = dns.name.from_text(qname, None)
if isinstance(rdtype, (str, unicode)):
rdtype = dns.rdatatype.from_text(rdtype)
+ if dns.rdatatype.is_metatype(rdtype):
+ raise NoMetaqueries
if isinstance(rdclass, (str, unicode)):
rdclass = dns.rdataclass.from_text(rdclass)
+ if dns.rdataclass.is_metaclass(rdclass):
+ raise NoMetaqueries
qnames_to_try = []
if qname.is_absolute():
qnames_to_try.append(qname)
diff --git a/lib/dnspython/dns/version.py b/lib/dnspython/dns/version.py
index fe0e324217..46799a77d9 100644
--- a/lib/dnspython/dns/version.py
+++ b/lib/dnspython/dns/version.py
@@ -17,7 +17,7 @@
MAJOR = 1
MINOR = 9
-MICRO = 2
+MICRO = 3
RELEASELEVEL = 0x0f
SERIAL = 0