interface MACs and LLDP neighbours do not survive save and reload #1521

Closed
opened 2026-11-15 18:01:10 +00:00 by jaylouisw · 0 comments
Owner

Two facts a real device carries are lost on serialisation:

  1. iface.mac is absent from the serialised interface fields (engine/device.js:851-887), and fromJSON calls _assignMacs(), so a document claiming 00:1b:21:aa:bb:cc reloads as 02:00:00:00:00:00.
  2. Per-interface lldp is written (engine/device.js:882) and Device.hydrate has no lldp branch, so a neighbour table evaporates - verified: d2.lldp.size 1 before save, 0 after load.

Why it matters: the importer being built needs to store a real switch's MAC table and neighbour table. Neither currently has anywhere to live, and the LLDP half is the precedent that must not be repeated - a provenance record that is written and never read back.

Suggested fix: carry mac through serialize/hydrate (and decide what _assignMacs does when a MAC is already present - it must not overwrite), and add the lldp branch to hydrate.

Two facts a real device carries are lost on serialisation: 1. `iface.mac` is absent from the serialised interface fields (`engine/device.js:851-887`), and `fromJSON` calls `_assignMacs()`, so a document claiming `00:1b:21:aa:bb:cc` reloads as `02:00:00:00:00:00`. 2. Per-interface `lldp` is written (`engine/device.js:882`) and `Device.hydrate` has no `lldp` branch, so a neighbour table evaporates - verified: `d2.lldp.size` 1 before save, 0 after load. **Why it matters:** the importer being built needs to store a real switch's MAC table and neighbour table. Neither currently has anywhere to live, and the LLDP half is the precedent that must not be repeated - a provenance record that is written and never read back. **Suggested fix:** carry `mac` through `serialize`/`hydrate` (and decide what `_assignMacs` does when a MAC is already present - it must not overwrite), and add the `lldp` branch to `hydrate`.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
jaylouisw/packetforge#1521
No description provided.