ARP parser: 'age' carries the expiry countdown, not the entry's age #17

Closed
opened 2026-10-18 16:15:18 +00:00 by christianmanivong · 1 comment
Owner

napalm_bsd/parse.py:161 sets age to the libxo expires value (float(expires) if expires else -1.0). expires counts down to the entry's expiry. NAPALM's age is the number of seconds since the entry was last seen, so it counts up. A large value here means a fresh entry, and readers that follow the NAPALM contract read it the other way round.

netOrk reads age as the age: the freshest entry per MAC is "lowest age", and since NetOrk/netork#1114 an entry is dated poll time - age.

Fix: report -1.0 (unknown) unless the real age can be derived, for example as net.link.ether.inet.max_age - expires, if that sysctl is read alongside.

Prio: P3. Found while fixing NetOrk/netork#1114. The same bug is in napalm-opnsense.

`napalm_bsd/parse.py:161` sets `age` to the libxo `expires` value (`float(expires) if expires else -1.0`). `expires` counts **down** to the entry's expiry. NAPALM's `age` is the number of seconds since the entry was last seen, so it counts **up**. A large value here means a fresh entry, and readers that follow the NAPALM contract read it the other way round. netOrk reads `age` as the age: the freshest entry per MAC is "lowest age", and since NetOrk/netork#1114 an entry is dated `poll time - age`. **Fix:** report `-1.0` (unknown) unless the real age can be derived, for example as `net.link.ether.inet.max_age - expires`, if that sysctl is read alongside. Prio: P3. Found while fixing NetOrk/netork#1114. The same bug is in napalm-opnsense.
Author
Owner

Already fixed on main by 1156da1 ("fix: an ARP entry's expiry is no age", PR #22, 2026-10-30): parse.py reports the age as unknown (-1.0, device-types' ARP_AGE_UNKNOWN) instead of the expiry countdown.

Already fixed on main by 1156da1 ("fix: an ARP entry's expiry is no age", PR #22, 2026-10-30): `parse.py` reports the age as unknown (-1.0, device-types' `ARP_AGE_UNKNOWN`) instead of the expiry countdown.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: NAPALM/napalm-bsd#17