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

Open
opened 2026-10-18 16:15:18 +00:00 by christianmanivong · 0 comments
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.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: NAPALM/napalm-bsd#17