summaryrefslogtreecommitdiff
path: root/dns
diff options
context:
space:
mode:
authorBob Halley <halley@nominum.com>2011-03-24 17:32:23 +0000
committerBob Halley <halley@nominum.com>2011-03-24 17:32:23 +0000
commit7dd82af325c158d38164203873f11ad39262f339 (patch)
tree4f8eab910b8e9be6dcf802567c847ee8e0dca32e /dns
parentf22dab80663303cc9bc233c410855bbece4de582 (diff)
downloaddnspython-7dd82af325c158d38164203873f11ad39262f339.tar.gz
deal with relative names in _wire_cmp
Diffstat (limited to 'dns')
-rw-r--r--dns/rdata.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/dns/rdata.py b/dns/rdata.py
index b4b9251..98f5047 100644
--- a/dns/rdata.py
+++ b/dns/rdata.py
@@ -259,10 +259,14 @@ class Rdata(object):
def _wire_cmp(self, other):
# A number of types compare rdata in wire form, so we provide
# the method here instead of duplicating it.
+ #
+ # We specifiy an arbitrary origin of '.' when doing the
+ # comparison, since the rdata may have relative names and we
+ # can't convert a relative name to wire without an origin.
b1 = cStringIO.StringIO()
- self.to_wire(b1)
+ self.to_wire(b1, None, dns.name.root)
b2 = cStringIO.StringIO()
- other.to_wire(b2)
+ other.to_wire(b2, None, dns.name.root)
return cmp(b1.getvalue(), b2.getvalue())
def from_text(cls, rdclass, rdtype, tok, origin = None, relativize = True):