From: Michael Tremer Date: Fri, 10 May 2024 16:04:43 +0000 (+0100) Subject: unbound-dhcp-leases-bridge: Use IPv4Address to store IP addresses X-Git-Tag: v2.29-core188~10^2~86^2~14 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=038c9db2bda048ff184e1fb9b4e2ef9b0ee1ff7b;p=ipfire-2.x.git unbound-dhcp-leases-bridge: Use IPv4Address to store IP addresses Signed-off-by: Michael Tremer --- diff --git a/config/unbound/unbound-dhcp-leases-bridge b/config/unbound/unbound-dhcp-leases-bridge index b4e212b385..604a172def 100644 --- a/config/unbound/unbound-dhcp-leases-bridge +++ b/config/unbound/unbound-dhcp-leases-bridge @@ -481,6 +481,9 @@ class FixLeases(object): class Lease(object): def __init__(self, ipaddr, properties): + if not isinstance(ipaddr, ipaddress.IPv4Address): + ipaddr = ipaddress.IPv4Address(ipaddr) + self.ipaddr = ipaddr self._properties = properties @@ -631,10 +634,10 @@ class Lease(object): return [ # Forward record - (self.fqdn, "%s" % LOCAL_TTL, "IN A", self.ipaddr), + (self.fqdn, "%s" % LOCAL_TTL, "IN A", "%s" % self.ipaddr), # Reverse record - (ip_address_to_reverse_pointer(self.ipaddr), "%s" % LOCAL_TTL, + (self.ipaddr.reverse_pointer, "%s" % LOCAL_TTL, "IN PTR", self.fqdn), ]