ARP Table - hostname taken from expired leases
Description based on discussion from https://forum.netgate.com/topic/161139/arp-bug-pfsense-2-5-0
In Diagnostic -> ARP Table sometimes you can find wrong values in Hostname column. For me it happens only for addresses which currently are static but some time ago were assigned by DHCP - in hostname column I get IP from the time when it wasn't static.
I opened diag_arp.inc and it looks that function system_get_dhcpleases (called in prepare_ARP_table) is returning double entries for one mac:
- old: with "type" = "dynamic", "act" = "expired" and "online" = "offline"
- new: with "type" = "static", "act" = "static" and "online" = "online"
But I don't know if this the only possible scenario that will give wrong results.
As an experiment I made diff (based on v2.5.0 git tag and attached to this issue) and at least host name column looks good but I don't have enough knowledge to tell if this is correct solution. But maybe it will point somebody to proper fix.