From e75b2c4775ccebf87904b54ed978590d96fc3c2b Mon Sep 17 00:00:00 2001 From: Cobra Date: Tue, 14 Apr 2026 15:38:30 -0400 Subject: [PATCH] Fix false presence: only trigger arrival on NUD_REACHABLE, not STALE/DELAY/PROBE Kernel fires RTM_NEWNEIGH for NUD_STALE, NUD_DELAY, and NUD_PROBE states as it probes a potentially-departed device. Each probe was calling on_arrival() which refreshed last_seen, preventing the watchdog from ever detecting departure. Only NUD_REACHABLE confirms a device is actually on the network. --- net_alerter/net_alerter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net_alerter/net_alerter.py b/net_alerter/net_alerter.py index 6c8c8b0..e594f84 100644 --- a/net_alerter/net_alerter.py +++ b/net_alerter/net_alerter.py @@ -1738,7 +1738,7 @@ def parse_ndmsg(data: bytes, msg_type: int) -> None: if not mac or mac in ('00:00:00:00:00:00', 'ff:ff:ff:ff:ff:ff'): return - if msg_type == RTM_NEWNEIGH and (state & (NUD_REACHABLE | NUD_STALE | NUD_DELAY | NUD_PROBE)): + if msg_type == RTM_NEWNEIGH and (state & NUD_REACHABLE): on_arrival(mac, ip or 'unknown') elif msg_type == RTM_DELNEIGH: on_departure(mac)