]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
_cmp() raised NoRelativeRdataOrdering in abs vs. abs case 703/head
authorBob Halley <halley@dnspython.org>
Thu, 14 Oct 2021 16:37:54 +0000 (09:37 -0700)
committerBob Halley <halley@dnspython.org>
Thu, 14 Oct 2021 16:37:54 +0000 (09:37 -0700)
dns/rdata.py

index 1917ecd48f3f59760a2e8839137cec8d8dcdb715..624063e00f864f134b047d0f1474ed83abdeff85 100644 (file)
@@ -264,13 +264,15 @@ class Rdata:
             our = self.to_digestable()
             our_relative = False
         except dns.name.NeedAbsoluteNameOrOrigin:
-            our = self.to_digestable(dns.name.root)
+            if _allow_relative_comparisons:
+                our = self.to_digestable(dns.name.root)
             our_relative = True
         try:
             their = other.to_digestable()
             their_relative = False
         except dns.name.NeedAbsoluteNameOrOrigin:
-            their = other.to_digestable(dns.name.root)
+            if _allow_relative_comparisons:
+                their = other.to_digestable(dns.name.root)
             their_relative = True
         if _allow_relative_comparisons:
             if our_relative != their_relative:
@@ -280,7 +282,7 @@ class Rdata:
                     return -1
                 else:
                     return 1
-        else:
+        elif our_relative or their_relative:
             raise NoRelativeRdataOrdering
         if our == their:
             return 0