]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
Fix metatype check.
authorBrian Wellington <bwelling@xbill.org>
Tue, 19 May 2020 16:51:37 +0000 (09:51 -0700)
committerBrian Wellington <bwelling@xbill.org>
Tue, 19 May 2020 16:51:37 +0000 (09:51 -0700)
IANA has reserved types 128-255 as meta types, so that range should be
checked.

dns/rdatatype.py

index 4e401af209608b5dcbd6116d6353a852fb2eef6a..68a5c2b9548f642708e098cd16eaa5d0971251c7 100644 (file)
@@ -203,9 +203,7 @@ def is_metatype(rdtype):
     Returns a ``bool``.
     """
 
-    if rdtype >= TKEY and rdtype <= ANY or rdtype in _metatypes:
-        return True
-    return False
+    return (256 > rdtype >= 128) or rdtype in _metatypes
 
 
 def is_singleton(rdtype):