From: Michael Tremer Date: Fri, 10 May 2024 16:46:45 +0000 (+0100) Subject: unbound-dhcp-leases-bridge: Drop parsing MAC addresses X-Git-Tag: v2.29-core188~10^2~86^2~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b79c0fc4ff9aa00f3cfd7e5230b63c6c22938e5b;p=ipfire-2.x.git unbound-dhcp-leases-bridge: Drop parsing MAC addresses We will represent the current state in DNS and we won't filter out anything that we think might be no longer valid. Signed-off-by: Michael Tremer --- diff --git a/config/unbound/unbound-dhcp-leases-bridge b/config/unbound/unbound-dhcp-leases-bridge index 5cc6e3d55a..4cfb165848 100644 --- a/config/unbound/unbound-dhcp-leases-bridge +++ b/config/unbound/unbound-dhcp-leases-bridge @@ -437,18 +437,9 @@ class DHCPLeases(object): if not "hardware" in properties: continue - lease = Lease(ipaddr, properties) - - # Check if a lease for this Ethernet address already - # exists in the list of known leases. If so replace - # if with the most recent lease - for i, l in enumerate(leases): - if l.ipaddr == lease.ipaddr: - leases[i] = max(lease, l) - break - else: - leases.append(lease) + lease = Lease(ipaddr, properties) + leases.append(lease) return leases @@ -514,7 +505,6 @@ class FixLeases(object): l = Lease(ipaddr, { "binding" : "state active", "client-hostname" : hostname, - "hardware" : "ethernet %s" % hwaddr, "starts" : now.strftime("%w %Y/%m/%d %H:%M:%S"), "ends" : "never", }) @@ -568,18 +558,6 @@ class Lease(object): @property def active(self): return self.binding_state == "active" - - @property - def hwaddr(self): - hardware = self._properties.get("hardware") - - if not hardware: - return - - ethernet, address = hardware.split(" ", 1) - - return address - @property def hostname(self): hostname = self._properties.get("client-hostname")