fix: an unknown ARP age is -1.0, not 0.0
driver / standard (pull_request) Successful in 18s
driver / lint (pull_request) Successful in 16s
driver / types (pull_request) Successful in 1m6s
driver / test (3.12) (pull_request) Successful in 6m5s
driver / test (3.13) (pull_request) Successful in 6m3s
driver / lowest (pull_request) Successful in 5m30s
driver / build (pull_request) Successful in 32s
driver / security (pull_request) Successful in 1m10s
CI / driver (pull_request) Successful in 7m43s
driver / publish (pull_request) Skipped

The host list says a host is active, not when the box last saw it, so
get_arp_table reports ARP_AGE_UNKNOWN instead of 0.0 ("confirmed just now").

NetOrk/netork#1327
This commit is contained in:
Christian Manivong committed 2026-10-30 08:37:08 +01:00
1 parent 666a5f0f35
commit e326350437
3 files changed
+14 -2

No files matched your search

+4 -2
View File
@@ -411,7 +411,9 @@ class FritzBoxDriver(ResidentialGatewayDriver):
def get_arp_table(self, vrf: str = "") -> list[dict[str, Any]]:
"""Return the ARP table, derived from :meth:`get_hosts`.
Each entry contains: ``interface``, ``mac``, ``ip``, ``age``.
Each entry contains: ``interface``, ``mac``, ``ip``, ``age``. The host
list says whether a host is active, not when the box last saw it, so
``age`` is ``-1.0`` (unknown, napalm-device-types' ``ARP_AGE_UNKNOWN``).
"""
arp_table: list[dict[str, Any]] = []
for host in self.get_hosts():
@@ -422,7 +424,7 @@ class FritzBoxDriver(ResidentialGatewayDriver):
"interface": host["interface_type"],
"mac": host["mac"],
"ip": host["ip"],
"age": 0.0,
"age": -1.0,
}
)
return arp_table