A port moved to another VLAN keeps its MAC entries; stale rows read as live (#1255) #1256
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jaylouisw/packetforge!1256
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/mac-table-vlan-flush"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A port moved to another VLAN keeps its MAC entries; stale rows read as live
Fixes #1255.
Before this change, moving
Fa0/2to VLAN 20 left its VLAN-1 entry in place indefinitely — a VLAN-1 entryon a port that carries VLAN 20, which is not a forwarding decision any switch could make. Entries here are
learned and overwritten, never aged out, and a membership change did not touch them.
Checked first: it is not a leak
The dangerous version of this bug is a frame from VLAN 1 being forwarded into a port that is now VLAN 20.
Measured before touching anything: the switch drops with
no egress ports in VLAN 1, and the only frame themoved host receives is the switch's own LLDP. VLAN isolation holds. This is a table that lies, not a
flood that escapes — worth stating, because the fix would have been very different.
Now
Device.flushMacsOnPort(name)drops one port's entries across every VLAN and reports how many it dropped;switchport access vlan,switchport mode,switchport trunk native vlan,switchport trunk allowed vlan,no switchport/ reset — so a membershipcommand added later inherits the same rule by calling the helper;
show mac address-tablemarks what the model still cannot know:show arpuses, so the twotables cannot describe one port state two ways;
(vlan mismatch);(name: gone)instead of printing nothing;stale — the same decision
show arpmade;Portssits under the header that names it.Evidence
test/mac-table.test.js— 21 checks:entry — and a flush on one port leaves another port's entries alone, including in another VLAN;
(vlan mismatch)for an entry in a VLAN its port does not carry, and(gone)for a removed port;flushMacsOnPortreports what it dropped, and is idempotent.Reverting
engine/cli.jsfails 5 of the 21; revertingengine/device.jsfails 2.docs/CLI.mdgains a "Readingshow mac address-table" section.Suite: 141 suites, 6,042 assertions, 0 failed.
show lldppresents stale neighbours as current, and its columns run together #1265show lldpmarks stale neighbours, and its columns no longer run together (#1265) #1266no vlanreports work it did not do #1277noform, andno vlanstops lying (#1277) #1278runtime[].countershas two shapes (drops/ports missing on idle devices) and hands out the engine's live record #1329