From: Brian Wellington Date: Wed, 18 Mar 2020 06:22:56 +0000 (-0700) Subject: Fix IPSECKEY relativity. X-Git-Tag: v2.0.0rc1~328^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fc74c9261dcd36fd1ec0f10d48c9c0fc56ce17ea;p=thirdparty%2Fdnspython.git Fix IPSECKEY relativity. --- diff --git a/dns/rdtypes/IN/IPSECKEY.py b/dns/rdtypes/IN/IPSECKEY.py index 8f49ba13..5e619239 100644 --- a/dns/rdtypes/IN/IPSECKEY.py +++ b/dns/rdtypes/IN/IPSECKEY.py @@ -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)