]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
unbound-dhcp-leases-bridge: Drop parsing MAC addresses
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 10 May 2024 16:46:45 +0000 (17:46 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 10 May 2024 16:46:45 +0000 (17:46 +0100)
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 <michael.tremer@ipfire.org>
config/unbound/unbound-dhcp-leases-bridge

index 5cc6e3d55a3e21fbbb54da706635d4567a8c1868..4cfb165848c562b541140940d6c896ffcef8a553 100644 (file)
@@ -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")