]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
Fix IPSECKEY relativity. 426/head
authorBrian Wellington <bwelling@xbill.org>
Wed, 18 Mar 2020 06:22:56 +0000 (23:22 -0700)
committerBrian Wellington <bwelling@xbill.org>
Wed, 18 Mar 2020 06:22:56 +0000 (23:22 -0700)
dns/rdtypes/IN/IPSECKEY.py

index 8f49ba137d57868005083781ca8f4fb7e79bd08b..5e619239f4959400b3069a73a15d3a111c383e76 100644 (file)
@@ -146,5 +146,11 @@ class IPSECKEY(dns.rdata.Rdata):
         else:
             raise dns.exception.FormError('invalid IPSECKEY gateway type')
         key = wire[current: current + rdlen].unwrap()
+        if origin is not None and gateway_type == 3:
+            gateway = gateway.relativize(origin)
         return cls(rdclass, rdtype, header[0], gateway_type, header[2],
                    gateway, key)
+
+    def choose_relativity(self, origin=None, relativize=True):
+        if self.gateway_type == 3:
+            self.gateway = self.gateway.choose_relativity(origin, relativize)